summaryrefslogtreecommitdiff
path: root/src/s2wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/s2wasm.h')
-rw-r--r--src/s2wasm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 34afbef52..81531ab3c 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -886,7 +886,10 @@ private:
zero = false;
} else if (match(".zero")) {
int32_t size = getInt();
- for (size_t i = 0; i < size; i++) {
+ if (size <= 0) {
+ abort_on(".zero with zero or negative size");
+ }
+ for (size_t i = 0, e = size; i < e; i++) {
raw->push_back(0);
}
} else if (match(".int32")) {