When generating inline_store code, don't weaken non-ref value on set
Dave Rolsky [Sun, 26 Sep 2010 05:19:16 +0000 (00:19 -0500)]
lib/Moose/Meta/Attribute.pm

index 640d1cc..342cbb6 100644 (file)
@@ -587,7 +587,7 @@ sub inline_set {
         = $mi->inline_set_slot_value( $instance, $self->slots, $value ) . ";";
     $code
         .= $mi->inline_weaken_slot_value( $instance, $self->slots, $value )
-        . ";"
+        . "    if ref $value;"
         if $self->is_weak_ref;
 
     return $code;