diff --git a/module/language/tree-il/optimize.scm b/module/language/tree-il/optimize.scm index 90931b457..2503e1426 100644 --- a/module/language/tree-il/optimize.scm +++ b/module/language/tree-il/optimize.scm @@ -450,8 +450,8 @@ it does not handle and , it should be called before (let* ((vals* (map (cut loop <> env calls) vals)) (vals (map maybe-unconst vals vals*)) (body* (loop body - (fold vhash-consq env gensyms vals) - calls)) + (fold vhash-consq env gensyms vals) + calls)) (body (maybe-unconst body body*))) (if (const? body*) body @@ -592,7 +592,13 @@ it does not handle and , it should be called before (($ ) app) (($ ) - app)) + app) + + ;; In practice, this is the clause that stops peval: + ;; module-ref applications (produced by macros, + ;; typically) don't match, and so this throws, + ;; aborting peval for an entire expression. + ) app))) (($ src meta body)