Created
April 19, 2020 17:15
-
-
Save MaxGraey/8ffc6a27b38ae66f7e3d87668e9b80e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type $t0 (func (param i32 i32))) | |
(type $t1 (func (param i32 i32) (result i32))) | |
(func $std.builtin.default_panic (type $t0) (param $p0 i32) (param $p1 i32) | |
(local $l2 i32) (local $l3 i32) (local $l4 i32) | |
global.get $g0 | |
local.set $l2 | |
i32.const 16 | |
local.set $l3 | |
local.get $l2 | |
local.get $l3 | |
i32.sub | |
local.set $l4 | |
local.get $l4 | |
local.get $p1 | |
i32.store offset=12 | |
loop $L0 | |
unreachable | |
br $L0 | |
end) | |
(func $add (type $t1) (param $p0 i32) (param $p1 i32) (result i32) | |
(local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i32) (local $l6 i32) (local $l7 i32) (local $l8 i32) (local $l9 i32) (local $l10 i32) (local $l11 i32) (local $l12 i32) (local $l13 i32) (local $l14 i32) (local $l15 i32) (local $l16 i32) (local $l17 i32) (local $l18 i32) | |
global.get $g0 | |
local.set $l2 | |
i32.const 16 | |
local.set $l3 | |
local.get $l2 | |
local.get $l3 | |
i32.sub | |
local.set $l4 | |
local.get $l4 | |
global.set $g0 | |
local.get $l4 | |
local.get $p0 | |
i32.store offset=8 | |
local.get $l4 | |
local.get $p1 | |
i32.store offset=4 | |
local.get $l4 | |
i32.load offset=8 | |
local.set $l5 | |
local.get $l4 | |
i32.load offset=4 | |
local.set $l6 | |
i32.const 0 | |
local.set $l7 | |
local.get $l6 | |
local.get $l7 | |
i32.lt_s | |
local.set $l8 | |
local.get $l5 | |
local.get $l6 | |
i32.add | |
local.set $l9 | |
local.get $l9 | |
local.get $l5 | |
i32.lt_s | |
local.set $l10 | |
local.get $l8 | |
local.get $l10 | |
i32.xor | |
local.set $l11 | |
i32.const 1 | |
local.set $l12 | |
local.get $l11 | |
local.get $l12 | |
i32.and | |
local.set $l13 | |
block $B0 | |
local.get $l13 | |
i32.eqz | |
br_if $B0 | |
i32.const 1044 | |
local.set $l14 | |
i32.const 0 | |
local.set $l15 | |
local.get $l14 | |
local.get $l15 | |
call $std.builtin.default_panic | |
unreachable | |
end | |
local.get $l4 | |
local.get $l9 | |
i32.store offset=12 | |
local.get $l4 | |
i32.load offset=12 | |
local.set $l16 | |
i32.const 16 | |
local.set $l17 | |
local.get $l4 | |
local.get $l17 | |
i32.add | |
local.set $l18 | |
local.get $l18 | |
global.set $g0 | |
local.get $l16 | |
return) | |
(table $T0 1 1 funcref) | |
(memory $memory 2) | |
(global $g0 (mut i32) (i32.const 66592)) | |
(export "memory" (memory 0)) | |
(export "add" (func $add)) | |
(data $d0 (i32.const 1024) "integer overflow\00\00\00\00\00\04\00\00\10\00\00\00")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment