DE-labtory / koa

The koa is a high-level language that has more expressions than the bitcoin script and is simpler and easy to analyze
Apache License 2.0
74 stars 18 forks source link

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

Open AgwaB opened 5 years ago

AgwaB commented 5 years ago

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)