Validate module metadata to be an object (#2357)

This commit is contained in:
itchyny authored and GitHub committed 2023-06-28 17:59:46 +09:00
1 parent 5dacc6b3a1
commit 6d694a4a58
7 files changed
+1702 -1389

No files matched your search

+4
View File
@@ -319,6 +319,10 @@ Module:
FAIL(@$, "Module metadata must be constant");
$$ = gen_noop();
block_free($2);
} else if (block_const_kind($2) != JV_KIND_OBJECT) {
FAIL(@$, "Module metadata must be an object");
$$ = gen_noop();
block_free($2);
} else {
$$ = gen_module($2);
}