New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] Coverity: change cannot-happen-test to a panic #13850
Comments
From @jhiCurrently the ix cannot ever be less than zero (detected by Coverity). |
From @jhi0001-Strengthen-the-ix-zero-min-clamping-to-panic.patchFrom c1be4f5a83dc6dad6c65a673abd703ae417e2fa2 Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Tue, 6 May 2014 11:52:02 -0400
Subject: [PATCH] Strengthen the ix zero min-clamping to panic.
Currently the ix cannot ever be less than zero (detected by Coverity).
Furthermore, it probably should never get less than zero, so panic if
that ever happens.
Fix for Coverity perl5 CID 28946.
---
pp_ctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pp_ctl.c b/pp_ctl.c
index 380a7fe..d63922d 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3088,7 +3088,7 @@ PP(pp_goto) /* also pp_dump */
I32 oldsave;
if (ix < 0)
- ix = 0;
+ DIE(aTHX_ "panic: docatch: illegal ix=%ld", (long)ix);
dounwind(ix);
TOPBLOCK(cx);
oldsave = PL_scopestack[PL_scopestack_ix];
--
1.8.5.2 (Apple Git-48)
|
The RT System itself - Status changed from 'new' to 'open' |
@tonycoz - Status changed from 'open' to 'resolved' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#121897 (status was 'resolved')
Searchable as RT121897$
The text was updated successfully, but these errors were encountered: