From ce3e5c451d1a009a73fa3a69c256b0fd8af3aa33 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 17 Apr 2006 13:14:55 +0000 Subject: [PATCH] Add assertions to cover cases where the Coverity scanner thinks we could are deferencing a NULL pointer, but we think it missed something it should have been capable of figuring out. p4raw-id: //depot/perl@27867 --- hv.c | 1 + op.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hv.c b/hv.c index cb36c2f..d912ccd 100644 --- a/hv.c +++ b/hv.c @@ -72,6 +72,7 @@ S_new_he(pTHX) if (!*root) S_more_he(aTHX); he = *root; + assert(he); *root = HeNEXT(he); UNLOCK_SV_MUTEX; return he; diff --git a/op.c b/op.c index 4b73d3f..57e4a1b 100644 --- a/op.c +++ b/op.c @@ -4384,7 +4384,9 @@ whileline, OP *expr, OP *block, OP *cont, I32 has_my) cont = append_elem(OP_LINESEQ, cont, unstack); } + assert(block); listop = append_list(OP_LINESEQ, (LISTOP*)block, (LISTOP*)cont); + assert(listop); redo = LINKLIST(listop); if (expr) { @@ -7171,6 +7173,7 @@ Perl_ck_split(pTHX_ OP *o) if (!kid->op_sibling) append_elem(OP_SPLIT, o, newSVOP(OP_CONST, 0, newSViv(0))); + assert(kid->op_sibling); kid = kid->op_sibling; scalar(kid); -- 2.7.4