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 */