Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a memory allocation bug in erlang:get_module_info/1 #781

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libAtomVM/nifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3394,7 +3394,7 @@ static term nif_erlang_get_module_info(Context *ctx, int argc, term argv[])
}
size_t info_size = module_get_exported_functions_list_size(target_module);
if (argc == 1) {
info_size += TUPLE_SIZE(2) + 3 * (TUPLE_SIZE(2) + CONS_SIZE);
info_size += 4 * (TUPLE_SIZE(2) + CONS_SIZE);
}
if (UNLIKELY(memory_ensure_free(ctx, info_size) != MEMORY_GC_OK)) {
RAISE_ERROR(OUT_OF_MEMORY_ATOM);
Expand Down