From 175da4d20630afd2c0ab5b9be5842c41694c2b35 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Tue, 22 Dec 2015 16:50:59 -0800 Subject: s2wasm: support .int8 and .int16 data This fixes a bunch of the torture test failures. --- src/s2wasm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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); -- cgit v1.2.3