Skip to content

Instantly share code, notes, and snippets.

@pyrocat101
Created November 25, 2014 22:34
Show Gist options
  • Save pyrocat101/0d7c97013a841b87e42d to your computer and use it in GitHub Desktop.
Save pyrocat101/0d7c97013a841b87e42d to your computer and use it in GitHub Desktop.
const vmt_B
:B.get_false
:B.get_true
:B.another_B_init
const vmt_C
:C.get_false
:B.get_true
:B.another_B_init
:C.c_init
func Main()
t.0 = HeapAllocZ(12)
if t.0 goto :null0
Error("null pointer")
null0:
[t.0] = :vmt_C
cc = t.0
t.1 = [cc]
t.1 = [t.1+12]
t.2 = call t.1(cc)
b = t.2
ret
func B.get_false(this)
ret 0
func B.get_true(this)
ret 1
func B.another_B_init(this)
PrintIntS(999)
t.0 = [this]
t.0 = [t.0+4]
t.1 = call t.0(this)
[this+4] = t.1
ret 1
func C.c_init(this)
t.0 = [this]
t.0 = [t.0+8]
t.1 = call t.0(this)
[this+8] = t.1
ret 0
func C.get_false(this)
ret 0
func AllocArray(size)
bytes = MulS(size 4)
bytes = Add(bytes 4)
v = HeapAllocZ(bytes)
[v] = size
ret v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment