summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-15 19:17:51 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-15 19:17:51 +0000
commitd4f41c0196a61a9d6f38ee42fc192ebf28ef6420 (patch)
tree2339a82c8db46b61bafb2446c9dea40a898f425b /sv.c
parent8498a5184cf05e744bf72b6e3f846f8deac7a425 (diff)
downloadperl-d4f41c0196a61a9d6f38ee42fc192ebf28ef6420.tar.gz
Deep in the bowels of creating new and exciting bugs, I managed to
segfault the uninitialised value reporting code. This protects against the segfault. p4raw-id: //depot/perl@27818
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 08d9b6a48c..8171c7fa51 100644
--- a/sv.c
+++ b/sv.c
@@ -12089,8 +12089,10 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
* or are optimized away, then it's unambiguous */
o2 = NULL;
for (kid=o; kid; kid = kid->op_sibling) {
+ SV *sv;
if (kid &&
- ( (kid->op_type == OP_CONST && SvOK(cSVOPx_sv(kid)))
+ ( (kid->op_type == OP_CONST && (sv = cSVOPx_sv(kid))
+ && SvOK(sv))
|| (kid->op_type == OP_NULL && ! (kid->op_flags & OPf_KIDS))
|| (kid->op_type == OP_PUSHMARK)
)