commit 6ba4e8afd38ac26834263548cd4c8e8a9ee610d1
parent fe4c7fb7c7edad6e8606692a77530e307b3e7c6c
Author: lash <dev@holbrook.no>
Date: Sat, 31 Aug 2024 17:22:52 +0100
Drop useless BLOCK flag
Diffstat:
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/engine/engine.go b/engine/engine.go
@@ -117,7 +117,7 @@ func(en *Engine) runFirst(ctx context.Context) (bool, error) {
// TODO: typed error
err = fmt.Errorf("Pre-VM code cannot have remaining bytecode after execution, had: %x", b)
} else {
- if en.st.MatchFlag(state.FLAG_BLOCK, true) {
+ if en.st.MatchFlag(state.FLAG_TERMINATE, true) {
en.exit = en.ca.Last()
Logg.InfoCtxf(ctx, "Pre-VM check says not to continue execution", "state", en.st)
} else {
@@ -128,7 +128,7 @@ func(en *Engine) runFirst(ctx context.Context) (bool, error) {
en.st.Invalidate()
en.ca.Invalidate()
}
- en.st.ResetFlag(state.FLAG_BLOCK)
+ en.st.ResetFlag(state.FLAG_TERMINATE)
Logg.DebugCtxf(ctx, "end pre-VM check")
return r, err
}
diff --git a/engine/engine_test.go b/engine/engine_test.go
@@ -356,7 +356,7 @@ func preBlock(ctx context.Context, sym string, input []byte) (resource.Result, e
log.Printf("executing preBlock")
return resource.Result{
Content: "None shall pass",
- FlagSet: []uint32{state.FLAG_BLOCK},
+ FlagSet: []uint32{state.FLAG_TERMINATE},
}, nil
}
diff --git a/state/flag.go b/state/flag.go
@@ -6,8 +6,8 @@ const (
FLAG_DIRTY
FLAG_WAIT
FLAG_LOADFAIL
+ FLAG_RESERVED
FLAG_TERMINATE
- FLAG_BLOCK
FLAG_LANG
FLAG_USERSTART = 8
)