Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add .clone method to Tree::Optimizer::Pass and ensure @!dependencies …

…is always initialized.
  • Loading branch information...
commit eb54e94a12abe0ad29af416b8670ecd0f8622792 1 parent 231e920
tcurtis authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/Tree/Optimizer/Pass.nqp
View
7 src/Tree/Optimizer/Pass.nqp
@@ -29,6 +29,11 @@ method new ($trans, *%adverbs) {
$self;
}
+method clone () {
+ self.new($!transformation, :name($!name), :recursive($!recursive),
+ :when($!when), :depends-on(pir::clone__PP(@!dependencies)));
+}
+
my $current-gen-name := 0;
sub gen-name () {
'__unnamed_' ~ $current-gen-name++;
@@ -43,6 +48,8 @@ method BUILD (:$transformation, :$name, :$recursive, :$when, *%rest) {
@!dependencies := (pir::isa__IPP($depends-on, String)
?? [ $depends-on ]
!! $depends-on);
+ } else {
+ @!dependencies := [];
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.