Skip to content

Commit bf7e40f

Browse files
authored
wasm-emscripten-finalize: Add more checking of __data_end global (#2352)
1 parent f5f53bb commit bf7e40f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/tools/wasm-emscripten-finalize.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ int main(int argc, const char* argv[]) {
197197
if (dataEnd->type != Type::i32) {
198198
Fatal() << "__data_end global has wrong type";
199199
}
200+
if (dataEnd->imported()) {
201+
Fatal() << "__data_end must not be an imported global";
202+
}
200203
Const* dataEndConst = dataEnd->init->cast<Const>();
201204
dataSize = dataEndConst->value.geti32() - globalBase;
202205
}

0 commit comments

Comments
 (0)