mirror of
https://github.com/kmc7468/cs420.git
synced 2026-11-04 08:10:29 +09:00
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:
1 parent
7a95032d43
commit
32283f2ed1
26 files changed
+331
-210
No files matched your search
@@ -0,0 +1,13 @@
|
||||
int g = 0;
|
||||
|
||||
int* foo() {
|
||||
g += 10;
|
||||
return &g;
|
||||
}
|
||||
|
||||
int main() {
|
||||
// `foo()` should be called once.
|
||||
*&*foo() += 1;
|
||||
|
||||
return g;
|
||||
}
|
||||
Reference in new issue
Block a user