summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_fun.h
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_fun.h')
-rw-r--r--erts/emulator/beam/erl_fun.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_fun.h b/erts/emulator/beam/erl_fun.h
index 43f3ec3b22..a67afaceeb 100644
--- a/erts/emulator/beam/erl_fun.h
+++ b/erts/emulator/beam/erl_fun.h
@@ -74,14 +74,15 @@ typedef struct erl_fun_thing {
/* -- The following may be compound Erlang terms ---------------------- */
Eterm creator; /* Pid of creator process (contains node). */
- Eterm env[1]; /* Environment (free variables). */
+ Eterm env[]; /* Environment (free variables). */
} ErlFunThing;
#define is_local_fun(FunThing) ((FunThing)->creator != am_external)
#define is_external_fun(FunThing) ((FunThing)->creator == am_external)
-/* ERL_FUN_SIZE does _not_ include space for the environment */
-#define ERL_FUN_SIZE ((sizeof(ErlFunThing)/sizeof(Eterm))-1)
+/* ERL_FUN_SIZE does _not_ include space for the environment which is a
+ * C99-style flexible array */
+#define ERL_FUN_SIZE ((sizeof(ErlFunThing)/sizeof(Eterm)))
ErlFunThing *erts_new_export_fun_thing(Eterm **hpp, Export *exp, int arity);
ErlFunThing *erts_new_local_fun_thing(Process *p,