Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #22617] IMCC duplicate labels in different subs cause wrong branch

5 views
Skip to first unread message

Clinton A. Pierce

unread,
Jun 8, 2003, 12:22:08 AM6/8/03
to bugs-bi...@rt.perl.org
# New Ticket Created by "Clinton A. Pierce"
# Please include the string: [perl #22617]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22617 >


The following code:

.sub _realmain
bsr FOO
call _function
end

FOO: print "In main's FOO"
ret
.end
.sub _function
bsr FOO
ret
FOO: print "in the function's FOO"
ret
.end

Causes "In main's FOO" to be printed twice. While an understandable
behavior, probably not the correct one. Language in parsing.pod indicates
that perhaps the labels should be munged by IMCC. If this *is* the
correct behavior, then a "duplicate label" error of some kind should be
emitted by IMCC.


Leopold Toetsch

unread,
Jun 8, 2003, 6:01:46 AM6/8/03
to perl6-i...@perl.org
Clinton A. Pierce <bugs-...@netlabs.develooper.com> wrote:
> Causes "In main's FOO" to be printed twice. While an understandable
> behavior, probably not the correct one.

... and not the documented one.
I did not strictly implement the documented behavior of global/local
labels until now, because some users of imcc didn't follow this
conventions, IIRC.

But anyway, its time to just break such (ab)usage, if its still existing.
So again and finally:

_global: labels get their address in fixup_bsrs()
local: labels can't be used to branch between different compilation
units.

Thanks for the bug report, fixed,
leo

0 new messages