Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compound assignment lvalue evaluated twice. #66

Open
andrewchambers opened this issue Jun 12, 2015 · 0 comments
Open

Compound assignment lvalue evaluated twice. #66

andrewchambers opened this issue Jun 12, 2015 · 0 comments

Comments

@andrewchambers
Copy link
Contributor

From standard:
6.5.16.2 Compound assignment

A compound assignment of the form E1 op= E2 is equivalent to the simple assignment expression E1  =  E1 op (E2) , except that the lvalue E1 is evaluated only once

Looking at the code, we are evaluating the lvalue twice, so things like side affecting functions on the lhs will be called twice.

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

No branches or pull requests

1 participant