You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Soundness: a local copied from an int field follows later writes to the field (int y = f; f = 5 gives y == 5) #565
Description
A local copied from an int field follows later writes to that field, as if it were an alias of the field rather than a copy of its value at that point.
Minimal reproducer
importliquidjava.specification.Refinement;
publicclassSnap {
intf;
voidm() {
inty = f;
f = 5;
@Refinement("_ == 5") intk = y; // y is the old value of f: should be rejected
}
}
Result on main: Correct! Passed Verification.
A related form, f > 0 ? (f = -1) : 1 checked against _ > 0, also passes.
Expected
The copy keeps the value the field had when it was read. A field read could get a fresh value (an instance) at the read, as locals and parameters already do, so a later write does not change it.
Activity