Skip to content

Commit

Permalink
Strengthen the ix zero min-clamping to panic.
Browse files Browse the repository at this point in the history
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.

[perl #121897]

Fix for Coverity perl5 CID 28946:
at_least: At condition ix < 0, the value of ix must be at least 0.
dead_error_condition: The condition ix < 0 cannot be true.
Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement ix = 0;
  • Loading branch information
jhi committed May 29, 2014
1 parent bcc60db commit 5edb797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pp_ctl.c
Expand Up @@ -3098,7 +3098,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];
Expand Down

0 comments on commit 5edb797

Please sign in to comment.