koa icon indicating copy to clipboard operation
koa copied to clipboard

[compiler, vm] When function type is void and return

Open AgwaB opened this issue 6 years ago • 0 comments

Proposal Detail When function return something, opcode RETURNING is push to stack size and offset of return value. but when function type is void and return, compiler push to stack size and offset and size is 0. offset is not matter.

ex)

func doSome() int {
    return 5
}

when see as bytecode -> Returning 1(size) 1(offset)

func doSome() {
    return
}

when see as bytecode -> Returning 0(size) 1(offset)

AgwaB avatar Feb 01 '19 14:02 AgwaB