diff options
author | Alon Zakai <azakai@google.com> | 2023-04-11 10:47:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 17:47:30 +0000 |
commit | 18898347e7c4ceb86988bdb8594160883f7886f0 (patch) | |
tree | ad934605a71cc8a3638b5388ae72c57cce08165f /test/example | |
parent | 160dda0aa5ecc8252c5862cd937157296d9015cb (diff) | |
download | binaryen-18898347e7c4ceb86988bdb8594160883f7886f0.tar.gz binaryen-18898347e7c4ceb86988bdb8594160883f7886f0.tar.bz2 binaryen-18898347e7c4ceb86988bdb8594160883f7886f0.zip |
Add a name hint to getValidName() (#5653)
Without the hint, we always look for a valid name using name$0, $1, $2, etc.,
starting from 0, and in some cases that can lead to quadratic behavior.
Noticed on a testcase in the fuzzer that runs for over 24 seconds (I gave up at
that point) but takes only 2 seconds with this.
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/module-splitting.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt index 9466f026e..09d6879ef 100644 --- a/test/example/module-splitting.txt +++ b/test/example/module-splitting.txt @@ -753,7 +753,7 @@ After: (table $0 1 funcref) (elem $0 (i32.const 0) $placeholder_0) (export "%foo" (func $bar)) - (export "%foo_0" (func $foo)) + (export "%foo_1" (func $foo)) (export "%table" (table $0)) (func $foo (type $none_=>_none) (nop) @@ -768,7 +768,7 @@ Secondary: (module (type $none_=>_none (func)) (import "primary" "%table" (table $0 1 funcref)) - (import "primary" "%foo_0" (func $foo)) + (import "primary" "%foo_1" (func $foo)) (elem $0 (i32.const 0) $bar) (func $bar (type $none_=>_none) (call $foo) |