diff options
author | Sverker Eriksson <[email protected]> | 2016-04-12 18:54:23 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-04-12 18:54:23 +0200 |
commit | 0f8f4e96ff8479018e5e921775654adc15f5e771 (patch) | |
tree | 33554de3cf013e6df61977bb5af4cd409197583f /lib/erl_interface/src/decode/decode_ref.c | |
parent | 5b31b2196bbb13ba650207f4ef94b2e1fa8f6121 (diff) | |
parent | e4b8b9be39601b1c79dfd5d8e807ae4c404b6935 (diff) | |
download | otp-0f8f4e96ff8479018e5e921775654adc15f5e771.tar.gz otp-0f8f4e96ff8479018e5e921775654adc15f5e771.tar.bz2 otp-0f8f4e96ff8479018e5e921775654adc15f5e771.zip |
Merge branch 'sverk/big-external-creations.OTP-13488'
Diffstat (limited to 'lib/erl_interface/src/decode/decode_ref.c')
-rw-r--r-- | lib/erl_interface/src/decode/decode_ref.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/erl_interface/src/decode/decode_ref.c b/lib/erl_interface/src/decode/decode_ref.c index a6b87e5a21..b8e1ebfedd 100644 --- a/lib/erl_interface/src/decode/decode_ref.c +++ b/lib/erl_interface/src/decode/decode_ref.c @@ -28,8 +28,9 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p) const char *s = buf + *index; const char *s0 = s; int count, i; + const char tag = get8(s); - switch (get8(s)) { + switch (tag) { case ERL_REFERENCE_EXT: if (p) { if (get_atom(&s, p->node, NULL) < 0) return -1; @@ -47,18 +48,23 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p) return 0; break; - case ERL_NEW_REFERENCE_EXT: + case ERL_NEW_REFERENCE_EXT: + case ERL_NEWER_REFERENCE_EXT: + /* first the integer count */ count = get16be(s); if (p) { p->len = count; if (get_atom(&s, p->node, NULL) < 0) return -1; - p->creation = get8(s) & 0x03; + if (tag == ERL_NEW_REFERENCE_EXT) + p->creation = get8(s) & 0x03; + else + p->creation = get32be(s); } else { if (get_atom(&s, NULL, NULL) < 0) return -1; - s += 1; + s += (tag == ERL_NEW_REFERENCE_EXT ? 1 : 4); } /* finally the id integers */ |