summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-11-05 14:49:11 +0000
committerSteve Peters <steve@fisharerojo.org>2005-11-05 14:49:11 +0000
commitd9aa96a49c0aa1ba55eb980309a89c366d8f0c06 (patch)
treeffa07f044e07f84ee2973531299720552b742363 /pp_hot.c
parent554a9ef59ec1a9e668d5bfd558b8533fc3f06147 (diff)
downloadperl-d9aa96a49c0aa1ba55eb980309a89c366d8f0c06.tar.gz
Kill warnings and add a panic to pp_defined() in case the wrong op
is passed in. p4raw-id: //depot/perl@26017
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 7b80467df6..f56b7de908 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -329,7 +329,7 @@ PP(pp_or)
PP(pp_defined)
{
dSP;
- register SV* sv;
+ register SV* sv = NULL;
bool defined = FALSE;
const int op_type = PL_op->op_type;
@@ -344,7 +344,8 @@ PP(pp_defined)
sv = POPs;
if (!sv || !SvANY(sv))
RETPUSHNO;
- }
+ } else
+ DIE(aTHX_ "panic: Invalid op passed to dd_defined()");
switch (SvTYPE(sv)) {
case SVt_PVAV:
@@ -371,11 +372,11 @@ PP(pp_defined)
if(op_type == OP_DOR)
--SP;
RETURNOP(cLOGOP->op_other);
- } else if (op_type == OP_DEFINED) {
- if(defined)
- RETPUSHYES;
- RETPUSHNO;
}
+ /* assuming OP_DEFINED */
+ if(defined)
+ RETPUSHYES;
+ RETPUSHNO;
}
PP(pp_add)