Fix continue labels in 'for' loops skipping the incrementor

This commit is contained in:
dcodeIO
2018-05-23 11:32:12 +02:00
parent c897b8405b
commit 829af2285c
36 changed files with 6930 additions and 6625 deletions

View File

@ -2104,44 +2104,46 @@
(unreachable)
)
)
(set_local $3
(i32.load offset=8
(get_local $0)
)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $2)
(get_local $3)
(block $break|0
(set_local $3
(i32.load offset=8
(get_local $0)
)
(block
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.shl
(get_local $2)
(i32.const 2)
)
)
(loop $loop|0
(br_if $break|0
(i32.ge_u
(get_local $2)
(get_local $3)
)
)
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.shl
(get_local $2)
(i32.const 2)
)
)
(get_local $1)
)
(return
(i32.const 1)
)
(get_local $1)
)
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
(return
(i32.const 1)
)
(block
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $loop|0)
)
(br $continue|0)
)
)
)
@ -2164,21 +2166,44 @@
(unreachable)
)
)
(set_local $3
(i32.load offset=8
(get_local $0)
)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $2)
(get_local $3)
(block $break|0
(set_local $3
(i32.load offset=8
(get_local $0)
)
(block
(if
(i32.eq
(i32.load
)
(loop $loop|0
(br_if $break|0
(i32.ge_u
(get_local $2)
(get_local $3)
)
)
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.shl
(get_local $2)
(i32.const 2)
)
)
)
(get_local $1)
)
(block
(if
(i32.lt_u
(i32.add
(get_local $2)
(i32.const 1)
)
(get_local $3)
)
(call $~lib/memory/move_memory
(i32.add
(i32.load
(get_local $0)
@ -2188,70 +2213,49 @@
(i32.const 2)
)
)
)
(get_local $1)
)
(block
(if
(i32.lt_u
(i32.add
(get_local $2)
(i32.const 1)
)
(get_local $3)
)
(call $~lib/memory/move_memory
(i32.add
(i32.load
(get_local $0)
)
(i32.shl
(get_local $2)
(i32.const 2)
)
)
(i32.add
(i32.load
(get_local $0)
)
(i32.shl
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.const 2)
)
)
(i32.sub
(i32.sub
(get_local $3)
(get_local $2)
)
(i32.const 1)
)
)
)
(i32.store offset=8
(get_local $0)
(i32.sub
(i32.load offset=8
(i32.add
(i32.load
(get_local $0)
)
(i32.shl
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.const 2)
)
)
(i32.sub
(i32.sub
(get_local $3)
(get_local $2)
)
(i32.const 1)
)
)
(return
)
(i32.store offset=8
(get_local $0)
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.const 1)
)
)
)
(set_local $2
(i32.add
(get_local $2)
(return
(i32.const 1)
)
)
(br $continue|0)
(block
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $loop|0)
)
)
)
)