summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRickard Green <rickard@erlang.org>2020-05-05 09:41:28 +0200
committerRickard Green <rickard@erlang.org>2020-05-05 09:41:28 +0200
commitb79d3ab050ee0985e59a2da0b125501db1ac1487 (patch)
treec6ddae9046b96f8229cbc566e84f52b3fc75e52f /lib
parent165a51f0cdc43bfc8f49781ae9871e8feea7b91a (diff)
downloaderlang-b79d3ab050ee0985e59a2da0b125501db1ac1487.tar.gz
Fix type set by ei_decode_ei_term()
Set the ei_type field to the same types set by ei_get_type().
Diffstat (limited to 'lib')
-rw-r--r--lib/erl_interface/src/misc/ei_decode_term.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/erl_interface/src/misc/ei_decode_term.c b/lib/erl_interface/src/misc/ei_decode_term.c
index 79c8fb4388..72f1e0d511 100644
--- a/lib/erl_interface/src/misc/ei_decode_term.c
+++ b/lib/erl_interface/src/misc/ei_decode_term.c
@@ -47,25 +47,30 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term)
break;
case ERL_FLOAT_EXT:
case NEW_FLOAT_EXT:
+ term->ei_type = ERL_FLOAT_EXT;
return (ei_decode_double(buf, index, &term->value.d_val) < 0
? -1 : 1);
case ERL_ATOM_EXT:
case ERL_ATOM_UTF8_EXT:
case ERL_SMALL_ATOM_EXT:
case ERL_SMALL_ATOM_UTF8_EXT:
+ term->ei_type = ERL_ATOM_EXT;
return (ei_decode_atom(buf, index, term->value.atom_name) < 0
? -1 : 1);
case ERL_REFERENCE_EXT:
case ERL_NEW_REFERENCE_EXT:
case ERL_NEWER_REFERENCE_EXT:
+ term->ei_type = ERL_NEW_REFERENCE_EXT;
return (ei_decode_ref(buf, index, &term->value.ref) < 0
? -1 : 1);
case ERL_PORT_EXT:
case ERL_NEW_PORT_EXT:
+ term->ei_type = ERL_PORT_EXT;
return (ei_decode_port(buf, index, &term->value.port) < 0
? -1 : 1);
case ERL_PID_EXT:
case ERL_NEW_PID_EXT:
+ term->ei_type = ERL_PID_EXT;
return (ei_decode_pid(buf, index, &term->value.pid) < 0
? -1 : 1);
case ERL_SMALL_TUPLE_EXT: