• Nils Goroll's avatar
    vcc: do not overwrite SUB symbol properties when call'ing · 006618c0
    Nils Goroll authored
    vcc_act_call() implements use-before-define semantics. To do so, it
    needs to instantiate SUB symbols if they do not exist.
    
    However, it wrongly called VCC_GlobalSymbol() also for existing
    symbols, overwriting symbol properties.
    
    In the case of the built-in subs, the symbol's lname (historically)
    still is the unescaped literal name, while user defined subs have
    their name escaped via VCC_GlobalSymbol() -> VCC_PrintCName().
    
    This made the wrong call to VCC_GlobalSymbol() apparent when a
    built-in sub was called with an explicit "call" action.
    
    Besides fixing the VCC_GlobalSymbol() call, we also need to set the
    lname and rname attributes for built-in SUB symbols initialized in
    VCC_New().
    
    Alternatively, we could also have used VCC_GlobalSymbol() there, but
    that would have affected other places where we (still) rely on the
    known name scheme of built-in subs, e.h. EmitStruct(). While the name
    unifaction was nice in general, I found the necessary changes (look up
    SUB symbols) not worth the benefit.
    
    Fixes #3719
    006618c0
vcc_action.c 11.2 KB