summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2020-09-18 18:37:24 +0200
committerGitHub <noreply@github.com>2020-09-18 09:37:24 -0700
commit76f76f9c01b43124c98769d9c92620c9a587dd62 (patch)
treedd68abcbb8c2f3c7a02dacbe6e4b566a47c2e0de /src
parent122f79d2030156857e5f5a581d060eb9edb2bfec (diff)
downloadwabt-76f76f9c01b43124c98769d9c92620c9a587dd62.tar.gz
wabt-76f76f9c01b43124c98769d9c92620c9a587dd62.tar.bz2
wabt-76f76f9c01b43124c98769d9c92620c9a587dd62.zip
Disallow "64-bit" flag if memory64 is disabled (#1547)
Fixes regressions in binary reader introduced by the implementation of the memory64 extension: https://github.com/WebAssembly/wabt/pull/1500.
Diffstat (limited to 'src')
-rw-r--r--src/binary-reader.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc
index 2ccda33a..a28a0ad9 100644
--- a/src/binary-reader.cc
+++ b/src/binary-reader.cc
@@ -587,6 +587,8 @@ Result BinaryReader::ReadMemory(Limits* out_page_limits) {
ERROR_UNLESS(unknown_flags == 0, "malformed memory limits flag: %d", flags);
ERROR_IF(is_shared && !options_.features.threads_enabled(),
"memory may not be shared: threads not allowed");
+ ERROR_IF(is_64 && !options_.features.memory64_enabled(),
+ "memory64 not allowed");
CHECK_RESULT(ReadU32Leb128(&initial, "memory initial page count"));
if (has_max) {
CHECK_RESULT(ReadU32Leb128(&max, "memory max page count"));