lcc
lcc copied to clipboard
Fixed the result of unary + to generate rvalue
Given an lvalue as an operand of the unary +
, lcc generates an lvalue even if it should not. Thus,
void foo(void)
{
int x, *p;
p = &+x;
+x = 0;
}
it silently accepts this incorrect code.
A simple fix for this issue is to make a RIGHT
tree when the result of +
is an lvalue, as done in constructing cast trees.