diff options
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 8 | ||||
-rw-r--r-- | erts/emulator/beam/beam_load.h | 2 | ||||
-rw-r--r-- | erts/emulator/beam/macros.tab | 6 |
3 files changed, 5 insertions, 11 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 9b8f33f576..7d3a19ff86 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -4840,11 +4840,7 @@ freeze_code(LoaderState* stp) ASSERT(this_patch < stp->ci); next_patch = codev[this_patch]; ASSERT(next_patch < stp->ci); - if (this_patch < stp->num_functions) { - codev[this_patch] = (BeamInstr) (codev + value); - } else { - codev[this_patch] = (BeamInstr) (codev + value - JUMP_OFFSET); - } + codev[this_patch] = (BeamInstr) (codev + value); this_patch = next_patch; } } @@ -4889,7 +4885,7 @@ final_touch(LoaderState* stp, struct erl_module_instance* inst_p) while (index != 0) { BeamInstr next = codev[index]; codev[index] = BeamOpCode(op_catch_yf); - catches = beam_catches_cons((BeamInstr *)codev[index+2]+JUMP_OFFSET, catches); + catches = beam_catches_cons((BeamInstr *)codev[index+2], catches); codev[index+2] = make_catch(catches); index = next; } diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h index 0b6543638f..c088bdb751 100644 --- a/erts/emulator/beam/beam_load.h +++ b/erts/emulator/beam/beam_load.h @@ -21,8 +21,6 @@ #ifndef _BEAM_LOAD_H # define _BEAM_LOAD_H -#define JUMP_OFFSET 0x5 - #include "beam_opcodes.h" #include "erl_process.h" diff --git a/erts/emulator/beam/macros.tab b/erts/emulator/beam/macros.tab index 959f7b28df..35460da1f4 100644 --- a/erts/emulator/beam/macros.tab +++ b/erts/emulator/beam/macros.tab @@ -29,8 +29,8 @@ REFRESH_GEN_DEST() { } SET_I_REL(Offset) { - ASSERT(VALID_INSTR(* (Eterm *)((BeamInstr *) ($Offset) + JUMP_OFFSET))); - I = (BeamInstr *) $Offset + JUMP_OFFSET; + ASSERT(VALID_INSTR(* (Eterm *)((BeamInstr *) ($Offset)))); + I = (BeamInstr *) $Offset; } SET_CP_I_ABS(Target) { @@ -39,7 +39,7 @@ SET_CP_I_ABS(Target) { } SET_REL_I(Dst, Offset) { - $Dst = (BeamInstr *) ($Offset) + JUMP_OFFSET; + $Dst = (BeamInstr *) ($Offset); ASSERT(VALID_INSTR(*$Dst)); } |