diff options
Diffstat (limited to 'csc')
| -rw-r--r-- | csc/linker-test.csc | 8 | ||||
| -rw-r--r-- | csc/linker.csc | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/csc/linker-test.csc b/csc/linker-test.csc index 3c24e90..adbcf91 100644 --- a/csc/linker-test.csc +++ b/csc/linker-test.csc @@ -19,8 +19,8 @@ (test link-labels (assert-equal '((alloc (local 0) (const 0)) - (jmp (const 1)) - (jmp (const 0))) + (jmp (const 2)) + (jmp (const 1))) (link '(((label 0) (jmp (label 1)) @@ -31,8 +31,8 @@ (test link-labels-are-unique-per-program (assert-equal '((alloc (local 0) (const 0)) - (jmp (const 0)) - (jmp (const 1))) + (jmp (const 1)) + (jmp (const 2))) (link '(((label 0) (jmp (label 0))) diff --git a/csc/linker.csc b/csc/linker.csc index 6502cb0..5e4e678 100644 --- a/csc/linker.csc +++ b/csc/linker.csc @@ -109,7 +109,7 @@ (list 'alloc (list 'local 0) (list 'const (num-globals environment)))) (translate-globals (loop for prog in programs - for off = 0 then (+ off (length converted-prog)) + for off = 1 then (+ off (length converted-prog)) for converted-prog = (translate-labels prog (make-label-map off prog)) |
