diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-09-11 12:08:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 12:08:14 -0700 |
commit | 249b4b78d765c0f83029c3afd107cbe9ea025681 (patch) | |
tree | 53b4bea406f7134a0b1bde8dda5291ad07a863fd /test/example | |
parent | f831369f8586f86cafe10ee4f34c9b1f239abbfc (diff) | |
download | binaryen-249b4b78d765c0f83029c3afd107cbe9ea025681.tar.gz binaryen-249b4b78d765c0f83029c3afd107cbe9ea025681.tar.bz2 binaryen-249b4b78d765c0f83029c3afd107cbe9ea025681.zip |
Binary format local parsing fixes (#1664)
* Error if there are more locals than browsers allow (50,000). We usually just warn about stuff like this, but we do need some limit (or else we hang or OOM), and if so, why not use the agreed-upon Web limit.
* Do not generate nice string names for locals in binary parsing - the name is just $var$x instead of $x, so not much benefit, and worse as our names are interned this is actually slow (which is why the fuzz testcase here hangs instead of OOMing).
Testcases and bugreport in #1663.
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 6 | ||||
-rw-r--r-- | test/example/c-api-unused-mem.txt | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index e4c371211..7fa1b4ea7 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -1041,10 +1041,10 @@ optimized: module loaded from binary form: (module (type $0 (func (param i32 i32) (result i32))) - (func $adder (; 0 ;) (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) + (func $adder (; 0 ;) (type $0) (param $0 i32) (param $1 i32) (result i32) (i32.add - (get_local $var$0) - (get_local $var$1) + (get_local $0) + (get_local $1) ) ) ) diff --git a/test/example/c-api-unused-mem.txt b/test/example/c-api-unused-mem.txt index 715a5e655..6e67735bd 100644 --- a/test/example/c-api-unused-mem.txt +++ b/test/example/c-api-unused-mem.txt @@ -55,11 +55,11 @@ (export "main" (func $main)) (export "rust_entry" (func $__wasm_start)) (func $main (; 0 ;) (type $0) - (local $var$0 i32) - (local $var$1 i32) - (local $var$2 i64) + (local $0 i32) + (local $1 i32) + (local $2 i64) (block $label$1 - (set_local $var$0 + (set_local $0 (i32.load (i32.const 0) ) @@ -80,7 +80,7 @@ (block $label$8 (i32.store (i32.const 0) - (get_local $var$0) + (get_local $0) ) (return) ) |