mescc: Fix global creation in AND/OR clause.
* module/language/c99/compiler.mes (test->jump->info): Retain globals created in AND/OR test.
This commit is contained in:
parent
e0a0a3798a
commit
7f3e44e361
|
@ -950,7 +950,8 @@
|
||||||
((eq ,a ,b) ((jump i386:Xjump-nz) o))
|
((eq ,a ,b) ((jump i386:Xjump-nz) o))
|
||||||
((not _) ((jump i386:Xjump-z) o))
|
((not _) ((jump i386:Xjump-z) o))
|
||||||
((and ,a ,b)
|
((and ,a ,b)
|
||||||
(let* ((text (.text info))
|
(let* ((globals (.globals info))
|
||||||
|
(text (.text info))
|
||||||
(info (clone info #:text '()))
|
(info (clone info #:text '()))
|
||||||
|
|
||||||
(a-jump ((test->jump->info info) a))
|
(a-jump ((test->jump->info info) a))
|
||||||
|
@ -962,12 +963,19 @@
|
||||||
(b-length (length (text->list b-text))))
|
(b-length (length (text->list b-text))))
|
||||||
|
|
||||||
(lambda (body-length)
|
(lambda (body-length)
|
||||||
(clone info #:text
|
(let* ((info (append-text info text))
|
||||||
(append text
|
(a-info (a-jump (+ b-length body-length)))
|
||||||
(.text (a-jump (+ b-length body-length)))
|
(info (append-text info (.text a-info)))
|
||||||
(.text (b-jump body-length)))))))
|
(b-info (b-jump body-length))
|
||||||
|
(info (append-text info (.text b-info))))
|
||||||
|
(clone info
|
||||||
|
#:globals (append globals
|
||||||
|
(list-tail (.globals a-info) (length globals))
|
||||||
|
(list-tail (.globals b-info) (length globals))))))))
|
||||||
|
|
||||||
((or ,a ,b)
|
((or ,a ,b)
|
||||||
(let* ((text (.text info))
|
(let* ((globals (.globals info))
|
||||||
|
(text (.text info))
|
||||||
(info (clone info #:text '()))
|
(info (clone info #:text '()))
|
||||||
|
|
||||||
(a-jump ((test->jump->info info) a))
|
(a-jump ((test->jump->info info) a))
|
||||||
|
@ -984,11 +992,16 @@
|
||||||
(jump-text (wrap-as (i386:Xjump b-length))))
|
(jump-text (wrap-as (i386:Xjump b-length))))
|
||||||
|
|
||||||
(lambda (body-length)
|
(lambda (body-length)
|
||||||
(clone info #:text
|
(let* ((info (append-text info text))
|
||||||
(append text
|
(a-info (a-jump jump-length))
|
||||||
(.text (a-jump jump-length))
|
(info (append-text info (.text a-info)))
|
||||||
jump-text
|
(info (append-text info jump-text))
|
||||||
(.text (b-jump body-length)))))))
|
(b-info (b-jump body-length))
|
||||||
|
(info (append-text info (.text b-info))))
|
||||||
|
(clone info
|
||||||
|
#:globals (append globals
|
||||||
|
(list-tail (.globals a-info) (length globals))
|
||||||
|
(list-tail (.globals b-info) (length globals))))))))
|
||||||
|
|
||||||
((array-ref . _) ((jump i386:jump-byte-z
|
((array-ref . _) ((jump i386:jump-byte-z
|
||||||
(wrap-as (i386:accu-zero?))) o))
|
(wrap-as (i386:accu-zero?))) o))
|
||||||
|
|
Loading…
Reference in New Issue