mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-25 20:51:44 +00:00
Fix continue labels in 'for' loops skipping the incrementor
This commit is contained in:
@ -9,24 +9,24 @@
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(set_global $for/i
|
||||
(i32.const 0)
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_global $for/i)
|
||||
(i32.const 10)
|
||||
)
|
||||
(block
|
||||
(set_global $for/i
|
||||
(i32.add
|
||||
(get_global $for/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block $break|0
|
||||
(set_global $for/i
|
||||
(i32.const 0)
|
||||
)
|
||||
(loop $loop|0
|
||||
(br_if $break|0
|
||||
(i32.ge_s
|
||||
(get_global $for/i)
|
||||
(i32.const 10)
|
||||
)
|
||||
(br $continue|0)
|
||||
)
|
||||
(set_global $for/i
|
||||
(i32.add
|
||||
(get_global $for/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $loop|0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -44,38 +44,38 @@
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(loop $continue|1
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_local $0)
|
||||
(i32.const 10)
|
||||
)
|
||||
(block
|
||||
(set_local $0
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block $break|1
|
||||
(loop $loop|1
|
||||
(br_if $break|1
|
||||
(i32.ge_s
|
||||
(get_local $0)
|
||||
(i32.const 10)
|
||||
)
|
||||
(br $continue|1)
|
||||
)
|
||||
(set_local $0
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $loop|1)
|
||||
)
|
||||
)
|
||||
(loop $continue|2
|
||||
(if
|
||||
(i32.gt_s
|
||||
(get_global $for/i)
|
||||
(i32.const 0)
|
||||
)
|
||||
(block
|
||||
(set_global $for/i
|
||||
(i32.sub
|
||||
(get_global $for/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block $break|2
|
||||
(loop $loop|2
|
||||
(br_if $break|2
|
||||
(i32.le_s
|
||||
(get_global $for/i)
|
||||
(i32.const 0)
|
||||
)
|
||||
(br $continue|2)
|
||||
)
|
||||
(set_global $for/i
|
||||
(i32.sub
|
||||
(get_global $for/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $loop|2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -91,7 +91,7 @@
|
||||
)
|
||||
)
|
||||
(block $break|3
|
||||
(loop $continue|3
|
||||
(loop $loop|3
|
||||
(br_if $break|3
|
||||
(i32.eq
|
||||
(get_global $for/i)
|
||||
@ -104,19 +104,54 @@
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $continue|3)
|
||||
(br $loop|3)
|
||||
)
|
||||
)
|
||||
(loop $continue|4
|
||||
(loop $loop|4
|
||||
(set_global $for/i
|
||||
(i32.sub
|
||||
(get_global $for/i)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br_if $continue|4
|
||||
(br_if $loop|4
|
||||
(get_global $for/i)
|
||||
)
|
||||
)
|
||||
(block $break|5
|
||||
(set_local $0
|
||||
(i32.const 0)
|
||||
)
|
||||
(loop $loop|5
|
||||
(br_if $break|5
|
||||
(i32.ge_s
|
||||
(get_local $0)
|
||||
(i32.const 10)
|
||||
)
|
||||
)
|
||||
(set_local $0
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $loop|5)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(get_local $0)
|
||||
(i32.const 10)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 19)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user