Update model solution.

- Stop calculating operands for & operators.
- Evaluate the lhs of compound operators only once.
- Add `side-effect.c` example.
This commit is contained in:
Jaewoo Kim
2025-04-07 11:03:18 +00:00
parent 7a95032d43
commit 32283f2ed1
26 changed files with 331 additions and 210 deletions

13
examples/c/side_effect.c Normal file
View File

@@ -0,0 +1,13 @@
int g = 0;
int* foo() {
g += 10;
return &g;
}
int main() {
// `foo()` should be called once.
*&*foo() += 1;
return g;
}