aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/decode/decode_pid.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-04-12 18:54:23 +0200
committerSverker Eriksson <[email protected]>2016-04-12 18:54:23 +0200
commit0f8f4e96ff8479018e5e921775654adc15f5e771 (patch)
tree33554de3cf013e6df61977bb5af4cd409197583f /lib/erl_interface/src/decode/decode_pid.c
parent5b31b2196bbb13ba650207f4ef94b2e1fa8f6121 (diff)
parente4b8b9be39601b1c79dfd5d8e807ae4c404b6935 (diff)
downloadotp-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_pid.c')
-rw-r--r--lib/erl_interface/src/decode/decode_pid.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/erl_interface/src/decode/decode_pid.c b/lib/erl_interface/src/decode/decode_pid.c
index 7fbb818b31..e5750caba6 100644
--- a/lib/erl_interface/src/decode/decode_pid.c
+++ b/lib/erl_interface/src/decode/decode_pid.c
@@ -27,18 +27,22 @@ int ei_decode_pid(const char *buf, int *index, erlang_pid *p)
{
const char *s = buf + *index;
const char *s0 = s;
+ const char tag = get8(s);
- if (get8(s) != ERL_PID_EXT) return -1;
+ if (tag != ERL_PID_EXT && tag != ERL_NEW_PID_EXT) return -1;
if (p) {
if (get_atom(&s, p->node, NULL) < 0) return -1;
p->num = get32be(s) & 0x7fff; /* 15 bits */
p->serial = get32be(s) & 0x1fff; /* 13 bits */
- p->creation = get8(s) & 0x03; /* 2 bits */
+ if (tag == ERL_PID_EXT)
+ p->creation = get8(s) & 0x03; /* 2 bits */
+ else
+ p->creation = get32be(s); /* 32 bits */
}
else {
if (get_atom(&s, NULL, NULL) < 0) return -1;
- s+= 9;
+ s+= (tag == ERL_PID_EXT ? 9 : 12);
}
*index += s-s0;