aboutsummaryrefslogtreecommitdiffstats
path: root/csc/codegen.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-07-24 20:29:19 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-24 20:29:19 -0700
commitac23fca796d6dc6fc7aab0ac5bdf8987aa490761 (patch)
tree05280a50eb2f9fb4229bb0e9d2be037ca4aa3d5c /csc/codegen.csc
parent498040c3d1532bb6de01dbbb55348f631c3745d6 (diff)
downloadchromatopelma-ac23fca796d6dc6fc7aab0ac5bdf8987aa490761.tar.zst
Write a test for codegen.
I'm not sure yet how to test regalloc.
Diffstat (limited to 'csc/codegen.csc')
-rw-r--r--csc/codegen.csc3
1 files changed, 2 insertions, 1 deletions
diff --git a/csc/codegen.csc b/csc/codegen.csc
index c51420e..aab8e23 100644
--- a/csc/codegen.csc
+++ b/csc/codegen.csc
@@ -27,6 +27,7 @@
closure-arguments
closure-body
closure-name
+ constant-expression
constant?
fix-body
fix-functions
@@ -186,7 +187,7 @@
else if (globals? arg)
do (set! in->out (insert in->out 0 i))
else if (constant? arg)
- collect (list 'mov (list 'local i) (list 'const arg))
+ collect (list 'mov (list 'local i) (list 'const (constant-expression arg)))
else if (label? arg)
collect (list 'mov (list 'local i) (list 'label (translate-label arg)))
else if (library-ref? arg)