fixed optimizer
authorFabien Potencier <fabien.potencier@gmail.com>
Thu, 30 Dec 2010 20:48:36 +0000 (21:48 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Thu, 30 Dec 2010 20:48:36 +0000 (21:48 +0100)
lib/Twig/NodeVisitor/Optimizer.php

index c149747..87b38e2 100644 (file)
@@ -113,6 +113,11 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
             $this->addLoopToCurrent();
         }
 
+        // block reference
+        elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) {
+            $this->addLoopToCurrent();
+        }
+
         // include without the only attribute
         elseif ($node instanceof Twig_Node_Include && !$node->getAttribute('only')) {
             $this->addLoopToAll();