mescc: prefix local labels with _.

* module/language/c99/compiler.mes (expr->accu): prefix local labels with _.
This commit is contained in:
Jan Nieuwenhuizen 2017-12-02 12:59:07 +01:00
parent e2b2e5b032
commit 60b7048e21

View file

@ -1201,7 +1201,7 @@
((or ,a ,b)
(let* ((info ((expr->accu info) a))
(here (number->string (length (.text info))))
(skip-b-label (string-append (.function info) "_" here "_or_skip_b"))
(skip-b-label (string-append "_" (.function info) "_" here "_or_skip_b"))
(info (append-text info (wrap-as (i386:accu-test))))
(info (append-text info (wrap-as (i386:jump-nz skip-b-label))))
(info (append-text info (wrap-as (i386:accu-test))))
@ -1213,7 +1213,7 @@
((and ,a ,b)
(let* ((info ((expr->accu info) a))
(here (number->string (length (.text info))))
(skip-b-label (string-append (.function info) "_" here "_and_skip_b"))
(skip-b-label (string-append "_" (.function info) "_" here "_and_skip_b"))
(info (append-text info (wrap-as (i386:accu-test))))
(info (append-text info (wrap-as (i386:jump-z skip-b-label))))
(info (append-text info (wrap-as (i386:accu-test))))
@ -2118,7 +2118,7 @@
((if ,test ,then)
(let* ((info (append-text info (ast->comment `(if ,test (ellipsis)))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(break-label (string-append label "break"))
(else-label (string-append label "else"))
(info ((test-jump-label->info info break-label) test))
@ -2131,7 +2131,7 @@
((if ,test ,then ,else)
(let* ((info (append-text info (ast->comment `(if ,test (ellipsis) (ellipsis)))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(break-label (string-append label "break"))
(else-label (string-append label "else"))
(info ((test-jump-label->info info else-label) test))
@ -2147,7 +2147,7 @@
((expr-stmt (cond-expr ,test ,then ,else))
(let* ((info (append-text info (ast->comment `(cond-expr ,test (ellipsis) (ellipsis)))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(else-label (string-append label "else"))
(break-label (string-append label "break"))
(info ((test-jump-label->info info else-label) test))
@ -2161,7 +2161,7 @@
((switch ,expr (compd-stmt (block-item-list . ,statements)))
(let* ((info (append-text info (ast->comment `(switch ,expr (compd-stmt (block-item-list (ellipsis)))))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(break-label (string-append label "break"))
(clauses (statements->clauses statements))
(info ((expr->accu info) expr))
@ -2177,7 +2177,7 @@
((for ,init ,test ,step ,body)
(let* ((info (append-text info (ast->comment `(for ,init ,test ,step (ellipsis)))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(break-label (string-append label "break"))
(loop-label (string-append label "loop"))
(continue-label (string-append label "continue"))
@ -2202,7 +2202,7 @@
((while ,test ,body)
(let* ((info (append-text info (ast->comment `(while ,test (ellipsis)))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(break-label (string-append label "break"))
(loop-label (string-append label "loop"))
(continue-label (string-append label "continue"))
@ -2223,7 +2223,7 @@
((do-while ,body ,test)
(let* ((info (append-text info (ast->comment `(do-while ,test (ellipsis)))))
(here (number->string (length text)))
(label (string-append (.function info) "_" here "_"))
(label (string-append "_" (.function info) "_" here "_"))
(break-label (string-append label "break"))
(loop-label (string-append label "loop"))
(continue-label (string-append label "continue"))
@ -2241,11 +2241,11 @@
#:continue (cdr (.continue info)))))
((labeled-stmt (ident ,label) ,statement)
(let ((info (append-text info `(((#:label ,(string-append (.function info) "_label_" label)))))))
(let ((info (append-text info `(((#:label ,(string-append "_" (.function info) "_label_" label)))))))
((ast->info info) statement)))
((goto (ident ,label))
(append-text info (wrap-as (i386:jump (string-append (.function info) "_label_" label)))))
(append-text info (wrap-as (i386:jump (string-append "_" (.function info) "_label_" label)))))
((return ,expr)
(let ((info ((expr->accu info) expr)))