-
Notifications
You must be signed in to change notification settings - Fork 601
Description
This bug report is similar to #23889. In the course of my research into the partial fatalization of goto LABEL (#23618), I have had occasion to try to determine which exceptions in pp_ctl.c are not exercised by our test suite, along with the locations of exceptions in the source code which are exercised by the test suite. I have located two more exceptions in pp_ctl.c which I believe are not exercised.
As in GH #23889, I proceed on the assumption that if I modify the message for a given exception, build the executable and run make test_harness and all tests PASS, then I infer that that exception has not been reached ("covered") by the test suite.
In the pp_ctl-more-unexercised-exceptions-20251119 branch on github, I made the following changes in pp_ctl.c:
diff --git a/pp_ctl.c b/pp_ctl.c
index 04f66a7b6f..219f503914 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2886,7 +2886,7 @@ PP(pp_return)
if(CxTYPE(&cxstack[i]) == CXt_DEFER)
/* diag_listed_as: Can't "%s" out of a "defer" block */
/* diag_listed_as: Can't "%s" out of a "finally" block */
- croak("Can't \"%s\" out of a \"%s\" block",
+ croak("LLL: Can't \"%s\" out of a \"%s\" block",
"return", S_defer_blockname(&cxstack[i]));
}
if (cxix < 0) {
@@ -3056,7 +3056,7 @@ S_unwind_loop(pTHX)
if(CxTYPE(&cxstack[i]) == CXt_DEFER)
/* diag_listed_as: Can't "%s" out of a "defer" block */
/* diag_listed_as: Can't "%s" out of a "finally" block */
- croak("Can't \"%s\" out of a \"%s\" block",
+ croak("MMM: Can't \"%s\" out of a \"%s\" block",
OP_NAME(PL_op), S_defer_blockname(&cxstack[i]));
}
dounwind(cxix);
Note that these exceptions sit in functions PP(pp_return) and S_unwind_loop(pTHX), respectively, which are different from the function discussed in GH #23889 (PP(pp_goto)).
When I ran make test_harness, the entire test suite PASSed. I infer that the croaks at lines 2889 and 3059 of pp_ctl.c are not yet exercised.
Can anyone suggest some tests by which we would cover these exceptions?