aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-08-13 14:41:07 +0200
committerSverker Eriksson <[email protected]>2019-08-13 14:49:24 +0200
commitc4ad27e24c8f28ad62f1d3afffaaa6033a460996 (patch)
tree025a3b5f1546ae1b09a8cc7669b19a3432d2a866
parent6618ce7b6a621e92db72ea4f01f7d38553c8818c (diff)
downloadotp-c4ad27e24c8f28ad62f1d3afffaaa6033a460996.tar.gz
otp-c4ad27e24c8f28ad62f1d3afffaaa6033a460996.tar.bz2
otp-c4ad27e24c8f28ad62f1d3afffaaa6033a460996.zip
erl_interface: Fix bug in ei_decode_fun for very old encoding
Found by valgrind test runs.
-rw-r--r--lib/erl_interface/src/decode/decode_fun.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/erl_interface/src/decode/decode_fun.c b/lib/erl_interface/src/decode/decode_fun.c
index 3a7a2b01c1..a7ceaa069e 100644
--- a/lib/erl_interface/src/decode/decode_fun.c
+++ b/lib/erl_interface/src/decode/decode_fun.c
@@ -52,7 +52,10 @@ int ei_decode_fun(const char *buf, int *index, erlang_fun *p)
switch (get8(s)) {
case ERL_FUN_EXT:
/* mark as old (R7 and older) external fun */
- if (p != NULL) p->arity = -1;
+ if (p != NULL) {
+ p->type = EI_FUN_CLOSURE;
+ p->arity = -1;
+ }
/* first number of free vars (environment) */
n = get32be(s);
/* then the pid */