Allocate the right HV
authorRafael Garcia-Suarez <rgs@consttype.org>
Mon, 7 Dec 2009 12:55:49 +0000 (13:55 +0100)
committerRafael Garcia-Suarez <rgs@consttype.org>
Mon, 7 Dec 2009 12:55:49 +0000 (13:55 +0100)
This will solve an obscure bug in smart-match involving nested data
structures containing the same elements.

pp_ctl.c

index 68a42d7..b196640 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4313,7 +4313,7 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other)
                    (void) sv_2mortal(MUTABLE_SV(seen_this));
                }
                if (NULL == seen_other) {
-                   seen_this = newHV();
+                   seen_other = newHV();
                    (void) sv_2mortal(MUTABLE_SV(seen_other));
                }
                for(i = 0; i <= other_len; ++i) {