From 73e1334e1d4fa8ffbfe9462ea6bdcbbcdf519566 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 5 Apr 2019 19:28:01 +0200 Subject: erl_interface: Fix maps arity from ei_get_type() --- lib/erl_interface/doc/src/ei.xml | 10 +++++----- lib/erl_interface/src/misc/get_type.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml index 26fe6f8831..d0d472c42b 100644 --- a/lib/erl_interface/doc/src/ei.xml +++ b/lib/erl_interface/doc/src/ei.xml @@ -731,12 +731,12 @@ ei_encode_tuple_header(buf, &i, 0); intei_get_type(const char *buf, const int *index, int *type, int *size) Fetch the type and size of an encoded term. -

Returns the type in type and size in - size of the encoded term. For strings and atoms, +

Returns the type in *type and size in + *size of the encoded term. For strings and atoms, size is the number of characters not including the - terminating NULL. For binaries, size is the number of - bytes. For lists and tuples, size is the arity of - the object. For other types, size is 0. In all + terminating NULL. For binaries and bitstrings, *size is + the number of bytes. For lists, tuples and maps, *size is the + arity of the object. For other types, *size is 0. In all cases, index is left unchanged.

diff --git a/lib/erl_interface/src/misc/get_type.c b/lib/erl_interface/src/misc/get_type.c index 1136423902..aa8ea1176b 100644 --- a/lib/erl_interface/src/misc/get_type.c +++ b/lib/erl_interface/src/misc/get_type.c @@ -55,6 +55,7 @@ int ei_get_type(const char *buf, const int *index, int *type, int *len) case ERL_LARGE_TUPLE_EXT: case ERL_LIST_EXT: + case ERL_MAP_EXT: case ERL_BINARY_EXT: *len = get32be(s); break; -- cgit v1.2.3