summaryrefslogtreecommitdiff
path: root/src/binary-reader.h
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2021-12-02 17:30:09 -0800
committerGitHub <noreply@github.com>2021-12-02 17:30:09 -0800
commit0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc (patch)
tree976045d56346480584f4c91eea47e7bd808db2a1 /src/binary-reader.h
parent952560950f176913c1f54525f250e30d26c2b49a (diff)
downloadwabt-0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc.tar.gz
wabt-0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc.tar.bz2
wabt-0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc.zip
Perform init expression validation outside of the binary reader. NFC (#1770)
Rather than spocial casing them in the reader we now use the same instruction callbacks for instruction that appear in init expressions as instructions that appear in normal functions. The result of this change is the validation of init expressions is pushed further up the stack. For example, objdump will now quite happily dump modules that use arbitrary instructions in thier init expressions even though they are not valid. To me, this makes sense since objdump does not do instruction validation elsewhere. The change is pre-cursor to allowing a wider variety of instruction to be present in init expressions. See https://github.com/WebAssembly/extended-const
Diffstat (limited to 'src/binary-reader.h')
-rw-r--r--src/binary-reader.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/binary-reader.h b/src/binary-reader.h
index 65095791..d000dd9b 100644
--- a/src/binary-reader.h
+++ b/src/binary-reader.h
@@ -460,17 +460,6 @@ class BinaryReaderDelegate {
virtual Result OnTagType(Index index, Index sig_index) = 0;
virtual Result EndTagSection() = 0;
- /* InitExpr - used by elem, data and global sections; these functions are
- * only called between calls to Begin*InitExpr and End*InitExpr */
- virtual Result OnInitExprF32ConstExpr(Index index, uint32_t value) = 0;
- virtual Result OnInitExprF64ConstExpr(Index index, uint64_t value) = 0;
- virtual Result OnInitExprV128ConstExpr(Index index, v128 value) = 0;
- virtual Result OnInitExprGlobalGetExpr(Index index, Index global_index) = 0;
- virtual Result OnInitExprI32ConstExpr(Index index, uint32_t value) = 0;
- virtual Result OnInitExprI64ConstExpr(Index index, uint64_t value) = 0;
- virtual Result OnInitExprRefNull(Index index, Type type) = 0;
- virtual Result OnInitExprRefFunc(Index index, Index func_index) = 0;
-
const State* state = nullptr;
};