aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-02-22 15:34:06 +0100
committerLukas Larsson <[email protected]>2017-02-22 15:34:06 +0100
commitae5ab58d64d18365a9b94a780760fd9c50119900 (patch)
tree4939e5dd3dda76c672f350a14ab0c15041bfd033
parentdd7ab7bb569470bc6c69d2c6e6dba2cbb5978575 (diff)
parent3671dd2d426208cf0639530b294da083b5e75acd (diff)
downloadotp-ae5ab58d64d18365a9b94a780760fd9c50119900.tar.gz
otp-ae5ab58d64d18365a9b94a780760fd9c50119900.tar.bz2
otp-ae5ab58d64d18365a9b94a780760fd9c50119900.zip
Merge branch 'lukas/erts/port_control_emasculate_binary/OTP-14231' into maint
* lukas/erts/port_control_emasculate_binary/OTP-14231: erts: Emasculate binaries that are scheduled in port_control
-rw-r--r--erts/emulator/beam/io.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 31396d06c6..9bf29ee230 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -4884,10 +4884,16 @@ erts_port_control(Process* c_p,
ASSERT(!tmp_alloced);
if (*ebinp == HEADER_SUB_BIN)
ebinp = binary_val(((ErlSubBin *) ebinp)->orig);
+
if (*ebinp != HEADER_PROC_BIN)
copy = 1;
else {
- binp = ((ProcBin *) ebinp)->val;
+ ProcBin *pb = (ProcBin *) ebinp;
+
+ if (pb->flags)
+ erts_emasculate_writable_binary(pb);
+
+ binp = pb->val;
ASSERT(bufp <= bufp + size);
ASSERT(binp->orig_bytes <= bufp
&& bufp + size <= binp->orig_bytes + binp->orig_size);