[Issue 16963] Wrong label name resolution in asm statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 18 07:54:31 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=16963

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
The assembler actually looks for labels first, as this code from
iasm.asm_primary_exp() shows:

    Dsymbol s;
    if (asmstate.sc.func.labtab)
        s = asmstate.sc.func.labtab.lookup(asmstate.tok.ident);
    if (!s)
        s = asmstate.sc.search(Loc.initial, asmstate.tok.ident, null);
    if (!s)
    {
        // Assume it is a label, and define that label
        s = asmstate.sc.func.searchLabel(asmstate.tok.ident);
    }

The trouble here is that the label sse is forward referenced, and undefined at
the time the asm statement is semantically checked.

--


More information about the Digitalmars-d-bugs mailing list