diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-08-07 15:57:22 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-08-07 15:57:22 -0700 |
| commit | ee97af100250652567c2b9bb82a9f34f1c154848 (patch) | |
| tree | a77ce965fde0802d5b851db1629a9c53d47bd2dc /lib | |
| parent | bd9855941c0ff4c877180d2a5fba4f073710fd5b (diff) | |
| download | chromatopelma-ee97af100250652567c2b9bb82a9f34f1c154848.tar.zst | |
Fix hoist.
Hoist needs to hoist the function bodies as well.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/csc/cps.csc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/csc/cps.csc b/lib/csc/cps.csc index 4fed47c..65bca89 100644 --- a/lib/csc/cps.csc +++ b/lib/csc/cps.csc @@ -54,6 +54,7 @@ (only (csc ir2) %apply %branch + %closure %fix %primitive %tail @@ -69,7 +70,6 @@ make-closure make-fix make-label - make-label make-primitive make-variable tail?) @@ -494,8 +494,10 @@ ((% %apply . _) expr) ((% %tail) expr) ((% %fix funs body) - (set! functions (append funs functions)) + (set! functions (append (map hoist funs) functions)) (hoist body)) + ((% %closure name args body) + (make-closure name args (hoist body))) (_ (error "Unexpected form in hoist" expr))))) (make-fix functions body)) |
