Implement ascend from catch code in vm runner
This commit is contained in:
parent
5e8cacd7bc
commit
28cbe308d4
@ -178,9 +178,13 @@ func(vm *Vm) RunCatch(b []byte, ctx context.Context) ([]byte, error) {
|
||||
}
|
||||
if r {
|
||||
log.Printf("catch at flag %v, moving to %v", sig, sym) //bitField, d)
|
||||
bh, err := vm.rs.GetCode(sym)
|
||||
if err != nil {
|
||||
return b, err
|
||||
}
|
||||
vm.st.Down(sym)
|
||||
vm.ca.Push()
|
||||
vm.Reset()
|
||||
bh := NewLine(nil, HALT, nil, nil, nil)
|
||||
b = append(bh, b...)
|
||||
}
|
||||
return b, nil
|
||||
|
@ -120,6 +120,7 @@ func(r TestResource) GetCode(sym string) ([]byte, error) {
|
||||
case "flagCatch":
|
||||
b = NewLine(b, MOUT, []string{"0", "repent"}, nil, nil)
|
||||
b = NewLine(b, HALT, nil, nil, nil)
|
||||
b = NewLine(b, MOVE, []string{"_"}, nil, nil)
|
||||
}
|
||||
|
||||
return b, nil
|
||||
|
Loading…
Reference in New Issue
Block a user