Skip to content

Commit

Permalink
Validate module metadata to be an object
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed May 26, 2022
1 parent cff5336 commit 87f994a
Show file tree
Hide file tree
Showing 5 changed files with 949 additions and 829 deletions.
1 change: 1 addition & 0 deletions src/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ jv block_list_funcs(block body, int omit_underscores) {
}

block gen_module(block metadata) {
assert(block_is_const(metadata) && block_const_kind(metadata) == JV_KIND_OBJECT);
inst* i = inst_new(MODULEMETA);
i->imm.constant = block_const(metadata);
if (jv_get_kind(i->imm.constant) != JV_KIND_OBJECT)
Expand Down
Loading

0 comments on commit 87f994a

Please sign in to comment.