diff options
author | Derek Schuff <dschuff@chromium.org> | 2016-10-03 21:41:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-03 21:41:43 -0700 |
commit | c4e70a04c42cdad380707d2e4b4f6f9503462414 (patch) | |
tree | 5c221b431b75e1729689a47857153756bc9e5c08 /src/binaryen-c.cpp | |
parent | 5046a524d506add48cb3779b39b4983e78292410 (diff) | |
download | binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.tar.gz binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.tar.bz2 binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.zip |
More binary updates for 0xc (#733)
Refine tables to explicitly exist or not. Previously they were printed
or encoded if it had any segments, or an initial or max size. However
tables can be defined but empty, so we had a special hack that defined
an empty segment when we really just wanted an empty table. Now, just
make the existence explicit.
Update Function table encoding for 0xc (Table and Element sections)
Add end opcodes after function bodies (these are consumed by
getMaybeBlock with the same behavior that it had before when it reached
the function end, so no explicit decode)
Update call_indirect encoding for 0xc (no arity, call target is last)
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r-- | src/binaryen-c.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 310757cad..b8933147f 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -756,6 +756,7 @@ void BinaryenSetFunctionTable(BinaryenModuleRef module, BinaryenFunctionRef* fun } auto* wasm = (Module*)module; + wasm->table.exists = true; Table::Segment segment(wasm->allocator.alloc<Const>()->set(Literal(int32_t(0)))); for (BinaryenIndex i = 0; i < numFuncs; i++) { segment.data.push_back(((Function*)funcs[i])->name); |