summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2015-12-22 16:50:59 -0800
committerJF Bastien <jfb@chromium.org>2015-12-22 16:50:59 -0800
commit175da4d20630afd2c0ab5b9be5842c41694c2b35 (patch)
treed01e0f382844e470c208635c56cdcbdba4de9bdf /src
parent9fd7cfcb3f50eac87016170e8c130674fd37fcd0 (diff)
downloadbinaryen-175da4d20630afd2c0ab5b9be5842c41694c2b35.tar.gz
binaryen-175da4d20630afd2c0ab5b9be5842c41694c2b35.tar.bz2
binaryen-175da4d20630afd2c0ab5b9be5842c41694c2b35.zip
s2wasm: support .int8 and .int16 data
This fixes a bunch of the torture test failures.
Diffstat (limited to 'src')
-rw-r--r--src/s2wasm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 7c42a81b0..b3c22d83d 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -895,6 +895,16 @@ private:
for (size_t i = 0, e = size; i < e; i++) {
raw->push_back(0);
}
+ } else if (match(".int8")) {
+ size_t size = raw->size();
+ raw->resize(size + 1);
+ (*(int8_t*)(&(*raw)[size])) = getInt();
+ zero = false;
+ } else if (match(".int16")) {
+ size_t size = raw->size();
+ raw->resize(size + 2);
+ (*(int16_t*)(&(*raw)[size])) = getInt();
+ zero = false;
} else if (match(".int32")) {
size_t size = raw->size();
raw->resize(size + 4);