summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sv.c10
-rw-r--r--t/lib/warnings/9uninit6
2 files changed, 9 insertions, 7 deletions
diff --git a/sv.c b/sv.c
index 3560c276eb..14ef56b6df 100644
--- a/sv.c
+++ b/sv.c
@@ -13903,9 +13903,11 @@ S_find_uninit_var(pTHX_ const OP *const obase, const SV *const uninit_sv,
break;
sv = hash ? MUTABLE_SV(GvHV(gv)): MUTABLE_SV(GvAV(gv));
}
- else /* @{expr}, %{expr} */
+ else if (obase == PL_op) /* @{expr}, %{expr} */
return find_uninit_var(cUNOPx(obase)->op_first,
uninit_sv, match);
+ else /* @{expr}, %{expr} as a sub-expression */
+ return NULL;
}
/* attempt to find a match within the aggregate */
@@ -14265,12 +14267,6 @@ S_find_uninit_var(pTHX_ const OP *const obase, const SV *const uninit_sv,
if ( (type == OP_CONST && SvOK(cSVOPx_sv(kid)))
|| (type == OP_NULL && ! (kid->op_flags & OPf_KIDS))
|| (type == OP_PUSHMARK)
- || (
- /* @$a and %$a, but not @a or %a */
- (type == OP_RV2AV || type == OP_RV2HV)
- && cUNOPx(kid)->op_first
- && cUNOPx(kid)->op_first->op_type != OP_GV
- )
)
continue;
}
diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit
index 6123fd03cb..12c1f84022 100644
--- a/t/lib/warnings/9uninit
+++ b/t/lib/warnings/9uninit
@@ -2031,3 +2031,9 @@ $a = @$a > 0;
EXPECT
Use of uninitialized value $a in array dereference at - line 3.
Use of uninitialized value in numeric gt (>) at - line 3.
+########
+# [perl #103766]
+use warnings 'uninitialized';
+"@{[ $x ]}";
+EXPECT
+Use of uninitialized value in join or string at - line 3.