1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00
2017-12-04 06:35:26 +00:00

17 lines
363 B
Go

package aml
// Args: val
// Set val as the return value in ctx and change the ctrlFlow
// type to ctrlFlowTypeFnReturn.
func vmOpReturn(ctx *execContext, ent Entity) *Error {
args := ent.getArgs()
if len(args) != 1 {
return errArgIndexOutOfBounds
}
var err *Error
ctx.ctrlFlow = ctrlFlowTypeFnReturn
ctx.retVal, err = vmLoad(ctx, args[0])
return err
}