diff options
author | Björn Gustavsson <[email protected]> | 2019-03-27 06:15:55 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-03-27 06:27:04 +0100 |
commit | 90e291e8fd42d6c9cf0695e940f34c92df1fa103 (patch) | |
tree | a75c5875b500d064842aa18db8f1526f4bc147d7 /erts/emulator/beam/beam_load.c | |
parent | f75cf3bd6c433f71b6fd6d58dee95b0c0fb8a238 (diff) | |
download | otp-90e291e8fd42d6c9cf0695e940f34c92df1fa103.tar.gz otp-90e291e8fd42d6c9cf0695e940f34c92df1fa103.tar.bz2 otp-90e291e8fd42d6c9cf0695e940f34c92df1fa103.zip |
Fix unsafe optimization made by the loader
Fix the unsafe load-time optimization introduced in 07bdbb3a1edc.
https://bugs.erlang.org/browse/ERL-899
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 21740caa2c..69e49e97f3 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3145,6 +3145,13 @@ is_killed(LoaderState* stp, GenOpArg Reg, GenOpArg Live) Live.val <= Reg.val; } +static int +is_killed_by_call_fun(LoaderState* stp, GenOpArg Reg, GenOpArg Live) +{ + return Reg.type == TAG_x && Live.type == TAG_u && + Live.val+1 <= Reg.val; +} + /* * Test whether register Reg is killed by make_fun instruction that * creates the fun given by index idx. |