aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-19 15:15:39 +0200
committerBjörn Gustavsson <[email protected]>2017-10-01 07:08:19 +0200
commite10dd6abd48a6f93b10b37673f31075a2264727a (patch)
tree4c79e808326a03b68f590d00e6b46d880cae3304 /erts/emulator/beam/beam_load.c
parent27c7c501b52f27eb252dc6b7633223bad7a732c4 (diff)
downloadotp-e10dd6abd48a6f93b10b37673f31075a2264727a.tar.gz
otp-e10dd6abd48a6f93b10b37673f31075a2264727a.tar.bz2
otp-e10dd6abd48a6f93b10b37673f31075a2264727a.zip
beam_load.c: Generalize the 'P' operator in the packing engine
In the 'P' operator, don't assume that a packed target label ('f' or 'j') is always the leftmost argument. Instead, transfer the patch position from the accumulator to the stack.
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 1fb284a303..9835b1c096 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -2636,15 +2636,15 @@ load_code(LoaderState* stp)
}
ci++;
break;
- case 'P': /* Put packed operands. */
+ case 'P': /* Put packed operands (on the stack). */
sp->instr = packed;
sp->patch_pos = 0;
- sp++;
- packed = 0;
if (packed_label) {
- packed_label->pos = ci;
+ sp->patch_pos = &packed_label->pos;
packed_label = 0;
}
+ sp++;
+ packed = 0;
break;
default:
ASSERT(0);