diff options
author | Heejin Ahn <aheejin@gmail.com> | 2022-06-27 12:19:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 12:19:27 -0700 |
commit | 7b7e2c56b7df43c7c6d99ef44dc4fff3b2e142bc (patch) | |
tree | 8cbb21f59c096444f5996cffacdeecef42dd1f03 /test | |
parent | 5811c2c7d50c10327565a23e19bf39c105593710 (diff) | |
download | binaryen-7b7e2c56b7df43c7c6d99ef44dc4fff3b2e142bc.tar.gz binaryen-7b7e2c56b7df43c7c6d99ef44dc4fff3b2e142bc.tar.bz2 binaryen-7b7e2c56b7df43c7c6d99ef44dc4fff3b2e142bc.zip |
[EH] Fix printing bug in nested blocks + delegate (#4753)
`controlFlowDepth` is a variable used to print `delegate`'s target. When
printing nested blocks, we increase `controlFlowDepth` by the number of
nested blocks at once. But we should decrement it as we finish each
block, rather than decrease by the number of nested blocks at once,
because we need correct `controlFlowDepth` within nested blocks.
Diffstat (limited to 'test')
-rw-r--r-- | test/exception-handling.wast | 13 | ||||
-rw-r--r-- | test/exception-handling.wast.from-wast | 13 | ||||
-rw-r--r-- | test/exception-handling.wast.fromBinary | 13 | ||||
-rw-r--r-- | test/exception-handling.wast.fromBinary.noDebugInfo | 13 |
4 files changed, 52 insertions, 0 deletions
diff --git a/test/exception-handling.wast b/test/exception-handling.wast index 1db356684..642856f03 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -352,4 +352,17 @@ ) ) ) + + ;; When 'delegate' is next to a nested block, make sure its delegate argument + ;; is parsed correctly. + (func $nested-block-and-try + (block $l0 + (block $l1) + (try + (do) + (delegate 1) ;; to caller + ) + ) + (nop) + ) ) diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast index c53f602d9..2427a1ee1 100644 --- a/test/exception-handling.wast.from-wast +++ b/test/exception-handling.wast.from-wast @@ -393,4 +393,17 @@ ) ) ) + (func $nested-block-and-try + (block $l0 + (block $l1 + ) + (try $try + (do + (nop) + ) + (delegate 1) + ) + ) + (nop) + ) ) diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index 29231a943..f88e54507 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -424,5 +424,18 @@ ) ) ) + (func $nested-block-and-try + (block $label$1 + (block $label$2 + ) + (try $label$5 + (do + (nop) + ) + (delegate 1) + ) + ) + (nop) + ) ) diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo index 16ab587b2..c65a216c3 100644 --- a/test/exception-handling.wast.fromBinary.noDebugInfo +++ b/test/exception-handling.wast.fromBinary.noDebugInfo @@ -424,5 +424,18 @@ ) ) ) + (func $7 + (block $label$1 + (block $label$2 + ) + (try $label$5 + (do + (nop) + ) + (delegate 1) + ) + ) + (nop) + ) ) |