From 1beabec188ca2effe3770c96faa0f93d71643f04 Mon Sep 17 00:00:00 2001 From: jnthn Date: Wed, 11 Feb 2009 14:00:00 +0100 Subject: [PATCH] We need to call .clone() rather than just using Parrot's clone vtable method fairly generally, I expect. This does that in a couple of places, which in turn resolves RT#63002 and gets an integration test passing. --- src/builtins/op.pir | 4 ++-- src/classes/Object.pir | 1 + src/classes/Range.pir | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/builtins/op.pir b/src/builtins/op.pir index 8c19da00495..6c798c6cb4b 100644 --- a/src/builtins/op.pir +++ b/src/builtins/op.pir @@ -30,7 +30,7 @@ src/builtins/op.pir - Perl 6 builtin operators ## autoincrement .sub 'postfix:++' :multi(_) .param pmc a - $P0 = clone a + $P0 = a.'clone'() $I0 = defined a if $I0 goto have_a 'infix:='(a, 0) @@ -41,7 +41,7 @@ src/builtins/op.pir - Perl 6 builtin operators .sub 'postfix:--' :multi(_) .param pmc a - $P0 = clone a + $P0 = a.'clone'() $I0 = defined a if $I0 goto have_a 'infix:='(a, 0) diff --git a/src/classes/Object.pir b/src/classes/Object.pir index cfbf2061ac5..1bd9fa0610c 100644 --- a/src/classes/Object.pir +++ b/src/classes/Object.pir @@ -52,6 +52,7 @@ like this. .local pmc p6meta, parrotclass, attributes, it p6meta = get_hll_global ['Perl6Object'], '$!P6META' parrotclass = p6meta.'get_parrotclass'(result) + if null parrotclass goto attrinit_done attributes = inspect parrotclass, 'attributes' it = iter attributes attrinit_loop: diff --git a/src/classes/Range.pir b/src/classes/Range.pir index a3bc69e9577..f0512369cb8 100644 --- a/src/classes/Range.pir +++ b/src/classes/Range.pir @@ -228,7 +228,7 @@ Generate the next element at the front of the Range. fromexc = getattribute self, '$!from_exclusive' value = 'postfix:++'(from) unless fromexc goto have_value - value = clone from + value = from.'clone'() have_value: $I0 = self.'!to_test'(value) if $I0 goto success