File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ bool BytecodeUtil::checkWasmHeader(std::string_view bytecode) {
2525
2626bool BytecodeUtil::getCustomSection (std::string_view bytecode, std::string_view name,
2727 std::string_view &ret) {
28+ // Check Wasm header.
29+ if (!checkWasmHeader (bytecode)) {
30+ return false ;
31+ }
32+
2833 // Skip the Wasm header.
2934 const char *pos = bytecode.data () + 8 ;
3035 const char *end = bytecode.data () + bytecode.size ();
@@ -107,6 +112,11 @@ bool BytecodeUtil::getFunctionNameIndex(std::string_view bytecode,
107112}
108113
109114bool BytecodeUtil::getStrippedSource (std::string_view bytecode, std::string &ret) {
115+ // Check Wasm header.
116+ if (!checkWasmHeader (bytecode)) {
117+ return false ;
118+ }
119+
110120 // Skip the Wasm header.
111121 const char *pos = bytecode.data () + 8 ;
112122 const char *end = bytecode.data () + bytecode.size ();
You can’t perform that action at this time.
0 commit comments