Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mycoboco
Copy link

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.

pol-rivero added a commit to pol-rivero/lcc that referenced this pull request Jul 22, 2021
Implement changes from: drh#19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant