From bbca8a99b1e3e25e8676a4dea223af7c78494800 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Mon, 11 May 2009 18:07:57 -0400 Subject: [PATCH] Solved a bug that occurred when using predefined routines inside functions. --- cfg.scm | 5 +++-- tests/picobit/picobit-vm-sixpic.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cfg.scm b/cfg.scm index 06bd795..48f7194 100644 --- a/cfg.scm +++ b/cfg.scm @@ -866,7 +866,8 @@ (define (include-predefined-routine proc) (define (get-bytes var) (value-bytes (def-variable-value var))) - (let ((id (def-id proc)) + (let ((old-proc current-def-proc) ; if we were already defining a procedure, save it + (id (def-id proc)) (params (def-procedure-params proc)) (value (def-procedure-value proc)) (old-bb bb) @@ -969,7 +970,7 @@ (gen-goto start-bb) (in after-bb)))) (return-with-no-new-bb proc) - (set! current-def-proc #f) + (set! current-def-proc old-proc) (resolve-all-gotos entry (list-named-bbs entry '()) '()) (in old-bb))) diff --git a/tests/picobit/picobit-vm-sixpic.c b/tests/picobit/picobit-vm-sixpic.c index 649042e..c86f3f5 100644 --- a/tests/picobit/picobit-vm-sixpic.c +++ b/tests/picobit/picobit-vm-sixpic.c @@ -68,15 +68,15 @@ int8 rom_get (int16 a){ /* int8 rom_get_field3 (int16 o); */ int8 ram_get_gc_tags (int16 o) { int16 t2 = o - 512; - return (*(((t2 << 2) + (0))+#x200) & #x60); + return (*(((t2 << 2))+#x200) & #x60); } int8 ram_get_gc_tag0 (int16 o) { int16 t2 = o - 512; - return (*(((t2 << 2) + (0))+#x200) & #x20); + return (*(((t2 << 2))+#x200) & #x20); } int8 ram_get_gc_tag1 (int16 o) { int16 t2 = o - 512; - return (*(((t2 << 2) + (0))+#x200) & #x40); + return (*(((t2 << 2))+#x200) & #x40); } void ram_set_gc_tags (int16 o, int8 tags) { int16 t2 = o - 512; -- 2.11.4.GIT