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

@ -377,75 +377,75 @@
(get_local $1)
)
)
(set_local $2
(select
(tee_local $2
(select
(get_local $2)
(i32.const 0)
(i32.gt_s
(block $break|0
(set_local $2
(select
(tee_local $2
(select
(get_local $2)
(get_local $3)
)
)
)
(tee_local $3
(tee_local $5
(i32.load
(get_local $0)
)
)
)
(i32.lt_s
(get_local $2)
(get_local $3)
)
)
)
(loop $continue|0
(if
(i32.le_s
(i32.add
(get_local $2)
(get_local $4)
)
(get_local $5)
)
(block
(if
(i32.eqz
(call $~lib/memory/compare_memory
(i32.add
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.shl
(get_local $2)
(i32.const 1)
)
)
(i32.add
(get_local $1)
(i32.const 4)
)
(i32.shl
(get_local $4)
(i32.const 1)
)
(i32.const 0)
(i32.gt_s
(get_local $2)
(get_local $3)
)
)
(return
(get_local $2)
)
(tee_local $3
(tee_local $5
(i32.load
(get_local $0)
)
)
)
(set_local $2
(i32.lt_s
(get_local $2)
(get_local $3)
)
)
)
(loop $loop|0
(br_if $break|0
(i32.gt_s
(i32.add
(get_local $2)
(get_local $4)
)
(get_local $5)
)
)
(if
(call $~lib/memory/compare_memory
(i32.add
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.shl
(get_local $2)
(i32.const 1)
)
)
(i32.add
(get_local $1)
(i32.const 4)
)
(i32.shl
(get_local $4)
(i32.const 1)
)
)
(br $continue|0)
(block
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $loop|0)
)
(return
(get_local $2)
)
)
)
)
@ -3629,49 +3629,49 @@
)
)
)
(set_local $2
(i32.const 0)
)
(set_local $1
(i32.mul
(tee_local $3
(i32.shl
(get_local $3)
(i32.const 1)
)
)
(get_local $1)
(block $break|0
(set_local $2
(i32.const 0)
)
)
(loop $continue|0
(if
(i32.lt_s
(get_local $2)
(set_local $1
(i32.mul
(tee_local $3
(i32.shl
(get_local $3)
(i32.const 1)
)
)
(get_local $1)
)
(block
(call $~lib/memory/move_memory
)
(loop $loop|0
(br_if $break|0
(i32.ge_s
(get_local $2)
(get_local $1)
)
)
(call $~lib/memory/move_memory
(i32.add
(i32.add
(i32.add
(get_local $4)
(i32.const 4)
)
(get_local $2)
)
(i32.add
(get_local $0)
(get_local $4)
(i32.const 4)
)
(get_local $2)
)
(i32.add
(get_local $0)
(i32.const 4)
)
(get_local $3)
)
(set_local $2
(i32.add
(get_local $2)
(get_local $3)
)
(set_local $2
(i32.add
(get_local $2)
(get_local $3)
)
)
(br $continue|0)
)
(br $loop|0)
)
)
(get_local $4)