unsigned int depth;
depth = unlang_frame_by_op_flag(stack, UNLANG_OP_FLAG_BREAK_POINT);
- if (depth == 0) return UNLANG_ACTION_CALCULATE_RESULT;
+ if (depth == 0) {
+ if (break_depth) *break_depth = stack->depth + 1; /* Don't cancel any frames! */
+ return UNLANG_ACTION_CALCULATE_RESULT;
+ }
unwind_to_depth(stack, depth + 1); /* cancel UP TO the break point */
unsigned int depth;
depth = unlang_frame_by_op_flag(stack, UNLANG_OP_FLAG_RETURN_POINT);
- if (depth == 0) return UNLANG_ACTION_CALCULATE_RESULT;
+ if (depth == 0) {
+ if (return_depth) *return_depth = stack->depth + 1; /* Don't cancel any frames! */
+ return UNLANG_ACTION_CALCULATE_RESULT;
+ }
unwind_to_depth(stack, depth + 1); /* cancel UP TO the break point */