summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-22 16:55:09 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-22 16:55:09 -0800
commit30e50a249b5addeef577dfd59501a569f34de920 (patch)
treed01e0f382844e470c208635c56cdcbdba4de9bdf /src
parent9fd7cfcb3f50eac87016170e8c130674fd37fcd0 (diff)
parent175da4d20630afd2c0ab5b9be5842c41694c2b35 (diff)
downloadbinaryen-30e50a249b5addeef577dfd59501a569f34de920.tar.gz
binaryen-30e50a249b5addeef577dfd59501a569f34de920.tar.bz2
binaryen-30e50a249b5addeef577dfd59501a569f34de920.zip
Merge pull request #31 from WebAssembly/int8-int16
s2wasm: support .int8 and .int16 data
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);