From e7379046328d84a9e157d44f7a3e7a7d45b13f47 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 29 Nov 2011 18:04:35 -0800 Subject: [PATCH] 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. --- sv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sv.c b/sv.c index f1fe1f2..70a912c 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) { -- 2.7.4