+ let
+ work_arg_ids = [v | Var v <- val_args] -- All guaranteed to be vars
+
+ -- these are the ids we pass to boxResult, which are used to decide
+ -- whether to touch# an argument after the call (used to keep
+ -- ForeignObj#s live across a 'safe' foreign import).
+ maybe_arg_ids | unsafe = []
+ | otherwise = work_arg_ids
+ in
+ boxResult work_arg_ids io_res_ty `thenDs` \ (ccall_result_ty, res_wrapper) ->
+
+ getUniqueDs `thenDs` \ ccall_uniq ->
+ getUniqueDs `thenDs` \ work_uniq ->