summaryrefslogtreecommitdiff
path: root/src/wasm-s-parser.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-28 18:10:46 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-03-28 18:10:46 -0700
commit5c1d36fb66b5aad63b02ab44433af201d22eebe0 (patch)
treede469d720c58c07ed1f83e65c3455a2964498830 /src/wasm-s-parser.h
parent68e15c423d92dd69138702cc572e503a33b31782 (diff)
parentcefb6b6e05c985524e885af17160b9e146f9b088 (diff)
downloadbinaryen-5c1d36fb66b5aad63b02ab44433af201d22eebe0.tar.gz
binaryen-5c1d36fb66b5aad63b02ab44433af201d22eebe0.tar.bz2
binaryen-5c1d36fb66b5aad63b02ab44433af201d22eebe0.zip
Merge branch 'vs2015_fixes' of https://github.com/juj/binaryen into vs2015_fixes
Conflicts: src/support/safe_integer.cpp
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r--src/wasm-s-parser.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 965336857..575ceff97 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -23,6 +23,8 @@
#define wasm_wasm_s_parser_h
#include <cmath>
+#include <cctype>
+#include <limits>
#include "wasm.h"
#include "mixed_arena.h"
@@ -825,8 +827,8 @@ private:
ret->align = atoi(eq);
} else if (str[0] == 'o') {
uint64_t offset = atoll(eq);
- if (offset > 0xffffffff) onError();
- ret->offset = offset;
+ if (offset > std::numeric_limits<uint32_t>::max()) onError();
+ ret->offset = (uint32_t)offset;
} else onError();
i++;
}