1
0
mirror of https://github.com/fluencelabs/assemblyscript synced 2025-04-28 08:22:15 +00:00

162 lines
2.8 KiB
Plaintext
Raw Normal View History

2018-02-10 09:45:49 +01:00
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $overflow/badByte (mut i32) (i32.const 255))
(global $overflow/anotherBadByte (mut i32) (i32.const 255))
(global $overflow/badIncrementer (mut i32) (i32.const 1))
(global $HEAP_BASE i32 (i32.const 36))
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $overflow/local (; 1 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:13:2
2018-02-10 09:45:49 +01:00
(set_local $0
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:13:20
2018-02-10 09:45:49 +01:00
(i32.const 255)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:14:2
2018-02-10 09:45:49 +01:00
(set_local $0
(i32.and
(i32.add
(get_local $0)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:14:13
2018-02-10 09:45:49 +01:00
(i32.const 1)
)
(i32.const 255)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:15:2
2018-02-10 09:45:49 +01:00
(if
(i32.eqz
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:15:9
2018-02-10 09:45:49 +01:00
(i32.eq
(get_local $0)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:15:20
2018-02-10 09:45:49 +01:00
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 8)
2018-02-10 09:59:22 +01:00
(i32.const 15)
2018-02-10 09:45:49 +01:00
(i32.const 2)
)
(unreachable)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:17:2
2018-02-10 09:45:49 +01:00
(set_local $1
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:17:27
2018-02-10 09:45:49 +01:00
(i32.const 255)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:18:2
2018-02-10 09:45:49 +01:00
(set_local $2
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:18:27
2018-02-10 09:45:49 +01:00
(i32.const 1)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:19:2
2018-02-10 09:45:49 +01:00
(set_local $1
(i32.and
(i32.add
(get_local $1)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:19:20
2018-02-10 09:45:49 +01:00
(get_local $2)
)
(i32.const 255)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:20:2
2018-02-10 09:45:49 +01:00
(if
(i32.eqz
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:20:9
2018-02-10 09:45:49 +01:00
(i32.eq
(get_local $1)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:20:27
2018-02-10 09:45:49 +01:00
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 8)
2018-02-10 09:59:22 +01:00
(i32.const 20)
2018-02-10 09:45:49 +01:00
(i32.const 2)
)
(unreachable)
)
)
)
(func $start (; 2 ;) (type $v)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:4:0
2018-02-10 09:45:49 +01:00
(set_global $overflow/badByte
(i32.and
(i32.add
(get_global $overflow/badByte)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:4:11
2018-02-10 09:45:49 +01:00
(i32.const 1)
)
(i32.const 255)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:5:0
2018-02-10 09:45:49 +01:00
(if
(i32.eqz
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:5:7
2018-02-10 09:45:49 +01:00
(i32.eq
(get_global $overflow/badByte)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:5:18
2018-02-10 09:45:49 +01:00
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 8)
2018-02-10 09:59:22 +01:00
(i32.const 5)
2018-02-10 09:45:49 +01:00
(i32.const 0)
)
(unreachable)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:9:0
2018-02-10 09:45:49 +01:00
(set_global $overflow/anotherBadByte
(i32.and
(i32.add
(get_global $overflow/anotherBadByte)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:9:18
2018-02-10 09:45:49 +01:00
(get_global $overflow/badIncrementer)
)
(i32.const 255)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:10:0
2018-02-10 09:45:49 +01:00
(if
(i32.eqz
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:10:7
2018-02-10 09:45:49 +01:00
(i32.eq
(get_global $overflow/anotherBadByte)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:10:25
2018-02-10 09:45:49 +01:00
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 8)
2018-02-10 09:59:22 +01:00
(i32.const 10)
2018-02-10 09:45:49 +01:00
(i32.const 0)
)
(unreachable)
)
)
2018-02-10 09:59:22 +01:00
;;@ overflow.ts:23:0
2018-02-10 09:45:49 +01:00
(call $overflow/local)
)
)