Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ class CastingVM(var image: CastingImage, val env: CastingEnvironment) {
resolutionType = ResolvedPatternType.ERRORED,
sound = HexEvalSounds.MISHAP,
)
} else if (result.newData != null && result.newData.opsConsumed > env.maxOpCount()) {
result.copy(
newData = null,
sideEffects = listOf(OperatorSideEffect.DoMishap(MishapEvalTooMuch(), Mishap.Context(null, null))),
resolutionType = ResolvedPatternType.ERRORED,
sound = HexEvalSounds.MISHAP,
)
} else {
result
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ public boolean toleratesOther(Iota that) {
continuation
);

if (result.getNewImage().getOpsConsumed() > vm.getEnv().maxOpCount()) {
throw new MishapEvalTooMuch();
}

var cont2 = result.getNewContinuation();
// TODO parens also break prescience
var sideEffects = result.getSideEffects();
Expand Down
Loading