Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Commit 43d23c9

Browse files
authored
Merge pull request #263 from ewasm/fold-brtable-operation
index.js: fully folded form for generated wast
2 parents fab478e + 958f92a commit 43d23c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ function assembleSegments (segments) {
383383
return `
384384
(func $main
385385
(export "main")
386-
(local $jump_dest i32)
386+
(local $jump_dest i32) (local $jump_map_switch i32)
387387
(set_local $jump_dest (i32.const -1))
388388
389389
(block $done
@@ -422,9 +422,9 @@ function buildJumpMap (segments) {
422422
)
423423
(else
424424
;; return callback destination and zero out $cb_dest
425-
get_global $cb_dest
425+
(set_local $jump_map_switch (get_global $cb_dest))
426426
(set_global $cb_dest (i32.const 0))
427-
(br_table $0 ${brTable})
427+
(br_table $0 ${brTable} (get_local $jump_map_switch))
428428
)))))`
429429

430430
return wasm

0 commit comments

Comments
 (0)