try-catch AGAIN

This commit is contained in:
TopchetoEU 2024-12-25 02:51:02 +02:00
parent b2f5068e12
commit c699102e56
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -293,9 +293,12 @@ public final class Frame {
if (error != null) { if (error != null) {
var caught = false; var caught = false;
for (var frame : dbg.getStackFrames()) { loop: for (var frame : Frame.get(env)) {
for (var tryCtx : frame.tryStack) { for (var tryCtx : frame.tryStack) {
if (tryCtx.state == TryState.TRY) caught = true; if (tryCtx.state == TryState.TRY) {
caught = true;
break loop;
}
} }
} }
@ -350,8 +353,8 @@ public final class Frame {
DebugContext.get(env).onFramePush(env, this); DebugContext.get(env).onFramePush(env, this);
} }
public void onPop() { public void onPop() {
get(env).pop();
DebugContext.get(env).onFramePop(env, this); DebugContext.get(env).onFramePop(env, this);
get(env).pop();
} }
/** /**
@ -398,6 +401,9 @@ public final class Frame {
} }
public static Frame get(Environment env, int i) { public static Frame get(Environment env, int i) {
var stack = get(env); var stack = get(env);
return stack.get(stack.size() - i - 1); i = stack.size() - i - 1;
if (i < 0 || i >= stack.size()) return null;
return stack.get(i);
} }
} }