diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-10-12 11:32:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-12 11:32:19 -0700 |
commit | a08ccc3cdc2e53354f0eaeba419655b641b2b056 (patch) | |
tree | 23e046ab21ac13c5b1ba522463bf0b6fc3e1da98 | |
parent | 2aad55d7fd4c8ad99d06937ab6838b0a0455e10a (diff) | |
download | binaryen-a08ccc3cdc2e53354f0eaeba419655b641b2b056.tar.gz binaryen-a08ccc3cdc2e53354f0eaeba419655b641b2b056.tar.bz2 binaryen-a08ccc3cdc2e53354f0eaeba419655b641b2b056.zip |
fix bug where we set memory max to the initial value if the max wasn't specified (#760)
-rw-r--r-- | src/wasm-s-parser.h | 2 | ||||
-rw-r--r-- | test/empty_imported_table.wast | 4 | ||||
-rw-r--r-- | test/empty_imported_table.wast.fromBinary | 5 | ||||
-rw-r--r-- | test/empty_imported_table.wast.fromBinary.noDebugInfo | 5 | ||||
-rw-r--r-- | test/imported_memory.wast | 3 | ||||
-rw-r--r-- | test/imported_memory.wast.fromBinary | 4 | ||||
-rw-r--r-- | test/imported_memory.wast.fromBinary.noDebugInfo | 4 | ||||
-rw-r--r-- | test/imported_memory_growth.wast | 3 | ||||
-rw-r--r-- | test/imported_memory_growth.wast.fromBinary | 4 | ||||
-rw-r--r-- | test/imported_memory_growth.wast.fromBinary.noDebugInfo | 4 |
10 files changed, 36 insertions, 2 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 3e09d4f6f..fda413f80 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1689,8 +1689,6 @@ private: } if (j < inner.size()) { wasm.memory.max = atoi(inner[j++]->c_str()); - } else { - wasm.memory.max = wasm.memory.initial; } } wasm.addImport(im.release()); diff --git a/test/empty_imported_table.wast b/test/empty_imported_table.wast new file mode 100644 index 000000000..7662c068e --- /dev/null +++ b/test/empty_imported_table.wast @@ -0,0 +1,4 @@ +(module + (import "env" "table" (table 0 0 anyfunc)) + (memory $0 0) +) diff --git a/test/empty_imported_table.wast.fromBinary b/test/empty_imported_table.wast.fromBinary new file mode 100644 index 000000000..5edee3018 --- /dev/null +++ b/test/empty_imported_table.wast.fromBinary @@ -0,0 +1,5 @@ +(module + (import "env" "table" (table 0 0 anyfunc)) + (memory $0 0) +) + diff --git a/test/empty_imported_table.wast.fromBinary.noDebugInfo b/test/empty_imported_table.wast.fromBinary.noDebugInfo new file mode 100644 index 000000000..5edee3018 --- /dev/null +++ b/test/empty_imported_table.wast.fromBinary.noDebugInfo @@ -0,0 +1,5 @@ +(module + (import "env" "table" (table 0 0 anyfunc)) + (memory $0 0) +) + diff --git a/test/imported_memory.wast b/test/imported_memory.wast new file mode 100644 index 000000000..fb3c45f5a --- /dev/null +++ b/test/imported_memory.wast @@ -0,0 +1,3 @@ +(module + (import "env" "memory" (memory $0 256 256)) +) diff --git a/test/imported_memory.wast.fromBinary b/test/imported_memory.wast.fromBinary new file mode 100644 index 000000000..bcbd85473 --- /dev/null +++ b/test/imported_memory.wast.fromBinary @@ -0,0 +1,4 @@ +(module + (import "env" "memory" (memory $0 256 256)) +) + diff --git a/test/imported_memory.wast.fromBinary.noDebugInfo b/test/imported_memory.wast.fromBinary.noDebugInfo new file mode 100644 index 000000000..bcbd85473 --- /dev/null +++ b/test/imported_memory.wast.fromBinary.noDebugInfo @@ -0,0 +1,4 @@ +(module + (import "env" "memory" (memory $0 256 256)) +) + diff --git a/test/imported_memory_growth.wast b/test/imported_memory_growth.wast new file mode 100644 index 000000000..d13b95853 --- /dev/null +++ b/test/imported_memory_growth.wast @@ -0,0 +1,3 @@ +(module + (import "env" "memory" (memory $0 256)) +) diff --git a/test/imported_memory_growth.wast.fromBinary b/test/imported_memory_growth.wast.fromBinary new file mode 100644 index 000000000..426313d7f --- /dev/null +++ b/test/imported_memory_growth.wast.fromBinary @@ -0,0 +1,4 @@ +(module + (import "env" "memory" (memory $0 256)) +) + diff --git a/test/imported_memory_growth.wast.fromBinary.noDebugInfo b/test/imported_memory_growth.wast.fromBinary.noDebugInfo new file mode 100644 index 000000000..426313d7f --- /dev/null +++ b/test/imported_memory_growth.wast.fromBinary.noDebugInfo @@ -0,0 +1,4 @@ +(module + (import "env" "memory" (memory $0 256)) +) + |