summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-29 18:04:35 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-29 18:04:35 -0800
commite7379046328d84a9e157d44f7a3e7a7d45b13f47 (patch)
treef6e8c0303ac9b4b93d1f99ffc33e84aab5cf2822 /sv.c
parentf9946bfddcb8263a2a12f0d56fe1d31ecdafcdec (diff)
downloadperl-e7379046328d84a9e157d44f7a3e7a7d45b13f47.tar.gz
sv.c/find_uninit_var: Explain kid-scanning loop better
Hopefully this explanation will be clearer and will prevent clumsy individuals like me from introducing bugs like #103766.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index f1fe1f2480..70a912c8c9 100644
--- a/sv.c
+++ b/sv.c
@@ -14265,8 +14265,13 @@ S_find_uninit_var(pTHX_ const OP *const obase, const SV *const uninit_sv,
if (!o)
break;
- /* if all except one arg are constant, or have no side-effects,
- * or are optimized away, then it's unambiguous */
+ /* This loop checks all the kid ops, skipping any that cannot pos-
+ * sibly be responsible for the uninitialized value; i.e., defined
+ * constants and ops that return nothing. If there is only one op
+ * left that is not skipped, then we *know* it is responsible for
+ * the uninitialized value. If there is more than one op left, we
+ * have to look for an exact match in the while() loop below.
+ */
o2 = NULL;
for (kid=o; kid; kid = kid->op_sibling) {
if (kid) {