[PATCH] D37497: [WebAssembly] Ensure that Wasm global that represent memory addresses are 32-bit const values

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 17:03:36 PDT 2017


dschuff added inline comments.


================
Comment at: lib/Object/WasmObjectFile.cpp:794
     const wasm::WasmGlobal& Global = Globals[GlobalIndex];
+    assert(Global.InitExpr.Opcode == wasm::WASM_OPCODE_I32_CONST);
     return Global.InitExpr.Value.Int32;
----------------
Is there any way this can happen other than bogus YAML files? (i.e. do we have binary-parsing code yet, that should also have some check?)


https://reviews.llvm.org/D37497





More information about the llvm-commits mailing list