Skip to content

Commit

Permalink
module_print_stats: check the existance of jump table correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Mar 3, 2023
1 parent 283d28d commit 69cf687
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,9 @@ module_print_stats(const struct module *m)
const struct expr_exec_info *ei = &e->ei;
jump_table_size += sizeof(ei->jumps);
jump_table_size += sizeof(ei->njumps);
jump_table_size += ei->njumps * sizeof(*ei->jumps);
if (ei->jumps != NULL) {
jump_table_size += ei->njumps * sizeof(*ei->jumps);
}
#if defined(TOYWASM_ENABLE_WRITER)
code_size += e->end - e->start;
#endif
Expand Down

0 comments on commit 69cf687

Please sign in to comment.