about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--mu.arc5
-rw-r--r--mu.arc.t22
2 files changed, 26 insertions, 1 deletions
diff --git a/mu.arc b/mu.arc
index c59a1010..9fbb642b 100644
--- a/mu.arc
+++ b/mu.arc
@@ -924,9 +924,12 @@
               nil  ; skip
             (is instr.0 'reply)
               (do
+                (when cdr.instr  ; return values
+                  (= instr.0 'prepare-reply)
+                  (yield instr))
                 (each instr (as cons deferred)
                   (yield instr))
-                (yield instr))
+                (yield '(reply)))
             :else
               (yield instr)))
       (each instr (as cons deferred)
diff --git a/mu.arc.t b/mu.arc.t
index a7e87147..6b16d129 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2798,6 +2798,28 @@
   (prn "F - convert-quotes inserts code at early exits"))
 
 (reset)
+(new-trace "convert-quotes-defer-reply-arg")
+(= traces* (queue))
+(if (~iso (convert-quotes
+            '(((1 integer) <- copy (0 literal))
+              (defer [
+                       ((5 integer) <- copy (0 literal))
+                     ])
+              ((2 integer) <- copy (0 literal))
+              (reply (2 literal))
+              ((3 integer) <- copy (0 literal))
+              ((4 integer) <- copy (0 literal))))
+          '(((1 integer) <- copy (0 literal))
+            ((2 integer) <- copy (0 literal))
+            (prepare-reply (2 literal))
+            ((5 integer) <- copy (0 literal))
+            (reply)
+            ((3 integer) <- copy (0 literal))
+            ((4 integer) <- copy (0 literal))
+            ((5 integer) <- copy (0 literal))))
+  (prn "F - convert-quotes inserts code at early exits"))
+
+(reset)
 (new-trace "convert-quotes-label")
 (= traces* (queue))
 (if (~iso (convert-quotes