aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-09-04 17:02:49 +0200
committerSverker Eriksson <[email protected]>2014-09-04 17:02:49 +0200
commite7f6333070080a3b71c5bba4b88c167220508b64 (patch)
treea90d878abecf6f9b712f6f490f7d2862868976ed /erts/emulator/beam
parentd65378620c73fb203ada59caa5fadee5bc660fe0 (diff)
parent267cf6cd5ba5e4392718c3c6f7f6467ac01ea2b0 (diff)
downloadotp-e7f6333070080a3b71c5bba4b88c167220508b64.tar.gz
otp-e7f6333070080a3b71c5bba4b88c167220508b64.tar.bz2
otp-e7f6333070080a3b71c5bba4b88c167220508b64.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_nif.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 1414744763..1caea6dcf8 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -472,6 +472,18 @@ int enif_inspect_binary(ErlNifEnv* env, Eterm bin_term, ErlNifBinary* bin)
struct enif_tmp_obj_t* tmp;
byte* raw_ptr;
}u;
+
+ if (is_boxed(bin_term) && *binary_val(bin_term) == HEADER_SUB_BIN) {
+ ErlSubBin* sb = (ErlSubBin*) binary_val(bin_term);
+ if (sb->is_writable) {
+ ProcBin* pb = (ProcBin*) binary_val(sb->orig);
+ ASSERT(pb->thing_word == HEADER_PROC_BIN);
+ if (pb->flags) {
+ erts_emasculate_writable_binary(pb);
+ sb->is_writable = 0;
+ }
+ }
+ }
u.tmp = NULL;
bin->data = erts_get_aligned_binary_bytes_extra(bin_term, &u.raw_ptr, allocator,
sizeof(struct enif_tmp_obj_t));