From: Jesse Luehrs Date: Fri, 15 Oct 2010 22:29:47 +0000 (-0500) Subject: don't use optimized path for non-lvalues X-Git-Tag: 1.16~51 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f878e6cf7d45abcecf1a144716c70bc64cf9f8bd;p=gitmo%2FMoose.git don't use optimized path for non-lvalues --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Writer.pm index b14ab4d..a73e666 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Writer.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Writer.pm @@ -148,10 +148,18 @@ sub _inline_set_new_value { my $self = shift; return $self->_inline_store(@_) - if $self->_value_needs_copy || !$self->_slot_access_can_be_inlined; + if $self->_value_needs_copy + || !$self->_slot_access_can_be_inlined + || !$self->_inline_get_is_lvalue; return $self->_inline_optimized_set_new_value(@_); -}; +} + +sub _inline_get_is_lvalue { + my $self = shift; + + return $self->associated_attribute->associated_class->instance_metaclass->inline_get_is_lvalue; +} sub _inline_optimized_set_new_value { my $self = shift;