diff options
author | John Högberg <[email protected]> | 2019-07-11 12:21:25 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-07-11 17:41:08 +0200 |
commit | 8c0bfd12802af3265d84b8bca247529633d05fcf (patch) | |
tree | e6d7a122d2afe29c82e8b074672fe35206a409e4 /lib/compiler/ebin | |
parent | 3967d28c05dae77db30b15e56eb4ececf4f1afef (diff) | |
download | otp-8c0bfd12802af3265d84b8bca247529633d05fcf.tar.gz otp-8c0bfd12802af3265d84b8bca247529633d05fcf.tar.bz2 otp-8c0bfd12802af3265d84b8bca247529633d05fcf.zip |
beam_validator: Values referenced by other values must be merged
This is a more proper fix for ERIERL-348. We used to think that
we wouldn't need to update the type of a variable that's no
longer referenced by a register ("dead value"), but the attached
test case pokes a hole in that assumption.
To summarize, the result of '=:='/2 is kept alive longer than one
of its arguments, which gets pruned in a state merge leaving us
with nothing to work on when we finally compare the result. This is
fine for most operations since there's no point in (say) updating
the size of a tuple we can no longer reach, but '=:='/2 updates
the types of both arguments and we risk missing out on important
information when either of them is gone.
This commit fixes the problem by merging all values that are
*reachable* from a register, rather than just those that *exist*
in a register, ensuring that all values stay around at least as
long as they're needed.
Diffstat (limited to 'lib/compiler/ebin')
0 files changed, 0 insertions, 0 deletions