summaryrefslogtreecommitdiff
path: root/src/binary-reader-nop.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-nop.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-nop.h')
-rw-r--r--src/binary-reader-nop.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/binary-reader-nop.h b/src/binary-reader-nop.h
index 6bad926b..f3aae0e2 100644
--- a/src/binary-reader-nop.h
+++ b/src/binary-reader-nop.h
@@ -549,33 +549,6 @@ class BinaryReaderNop : public BinaryReaderDelegate {
return Result::Ok;
}
Result EndLinkingSection() override { return Result::Ok; }
-
- /* InitExpr - used by elem, data and global sections; these functions are
- * only called between calls to Begin*InitExpr and End*InitExpr */
- Result OnInitExprF32ConstExpr(Index index, uint32_t value) override {
- return Result::Ok;
- }
- Result OnInitExprF64ConstExpr(Index index, uint64_t value) override {
- return Result::Ok;
- }
- Result OnInitExprV128ConstExpr(Index index, v128 value) override {
- return Result::Ok;
- }
- Result OnInitExprGlobalGetExpr(Index index, Index global_index) override {
- return Result::Ok;
- }
- Result OnInitExprI32ConstExpr(Index index, uint32_t value) override {
- return Result::Ok;
- }
- Result OnInitExprI64ConstExpr(Index index, uint64_t value) override {
- return Result::Ok;
- }
- Result OnInitExprRefNull(Index index, Type type) override {
- return Result::Ok;
- }
- Result OnInitExprRefFunc(Index index, Index func_index) override {
- return Result::Ok;
- }
};
} // namespace wabt