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
- Instead of comparing the identity of the `PointerValue`s, compare the
underlying `StorageLocation`s.
- If the `StorageLocation`s are different, return a definite "false" as the
result of the comparison. Before, if the `PointerValue`s were different, the
best we could do was to return an atom (because the `StorageLocation`s might
still be the same).
On an internal codebase, this change reduces SAT solver timeouts by over 20% and
"maximum iterations reached" errors by over 50%. In addition, it obviously
improves the precision of the analysis.
@Xazax-hun inspired me to think about this with his
[comments](#73860 (review))
on a different PR.
The one thing where the new code currently does the wrong thing is when
comparing the addresses of different members of a union. By the language
standard, all members of a union should have the same address, but we currently
model them with different `StorageLocation`s, and so with this change, we will
return false when comparing the addreses.
I propose that this is acceptable because is unlikely to affect the behavior of
real-world code in meaningful ways.
With this change, the test TransferTest.DifferentReferenceLocInJoin started to
fail because the code under test no longer set up the desired state where a
variable of reference type is mapped to two different storage locations in
environments being joined. Rather than trying to modify this test to set up the
test condition again, I have chosen to replace the test with an equivalent
test in DataflowEnvironmentTest.cpp that sets up the test condition directly;
because this test is more direct, it will also be less brittle in the face of
future changes.
0 commit comments