aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-09-30 16:55:06 +0200
committerSverker Eriksson <[email protected]>2015-01-21 16:08:28 +0100
commit57d819805eb032605c64a0128dd70955d7aa085a (patch)
treeb87e6901b1df11ea450fc90c74df323f7b73f002
parent25237481ccccd3ddfa74582dc267632ad618ba30 (diff)
downloadotp-57d819805eb032605c64a0128dd70955d7aa085a.tar.gz
otp-57d819805eb032605c64a0128dd70955d7aa085a.tar.bz2
otp-57d819805eb032605c64a0128dd70955d7aa085a.zip
erts: Fix erlang:port_set_data/2 for non immediate data
hsize field was not set leading to VM crash
-rw-r--r--erts/emulator/beam/erl_bif_port.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_port.c b/erts/emulator/beam/erl_bif_port.c
index 3cd53ef65d..f4ab8592ae 100644
--- a/erts/emulator/beam/erl_bif_port.c
+++ b/erts/emulator/beam/erl_bif_port.c
@@ -554,6 +554,7 @@ BIF_RETTYPE port_set_data_2(BIF_ALIST_2)
hp = &pdhp->heap[0];
pdhp->off_heap.first = NULL;
pdhp->off_heap.overhead = 0;
+ pdhp->hsize = hsize;
pdhp->data = copy_struct(BIF_ARG_2, hsize, &hp, &pdhp->off_heap);
data = (erts_aint_t) pdhp;
ASSERT((data & 0x3) == 0);