Does this look all right?

Commit message:

    tccgen.c: When handling '.' operator, cope with VT_LLOCAL.
    
    If vtop->r before gaddrof() was (VT_LLOCAL | VT_LVAL) and the field
    offset was zero, so gen_op('+') was optimised away, then vtop->r
    can be (VT_LOCAL | VT_LVAL) after the '+', in which case we must
    reinstate the VT_LLOCAL instead of just setting VT_LVAL.
diff --git a/tccgen.c b/tccgen.c
index 510051a..220cedf 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -4024,6 +4024,8 @@ ST_FUNC void unary(void)
             vtop->type.t |= qualifiers;
             /* an array is never an lvalue */
             if (!(vtop->type.t & VT_ARRAY)) {
+                if ((vtop->r & (VT_VALMASK | VT_LVAL)) == (VT_LOCAL | VT_LVAL))
+                    vtop->r += VT_LLOCAL - VT_LOCAL;
                 vtop->r |= lvalue_type(vtop->type.t);
 #ifdef CONFIG_TCC_BCHECK
                 /* if bound checking, the referenced pointer must be checked */
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to