From 9ab8c26d23cca2b896b049a9de775037e31e0560 Mon Sep 17 00:00:00 2001 From: phalcon Date: Sat, 4 Apr 2015 14:51:55 -0600 Subject: [PATCH] Fixed custom optimizers --- optimizers/PhannotParseAnnotationsOptimizer.php | 9 ++++++--- optimizers/PhqlParsePhqlOptimizer.php | 2 +- optimizers/PhvoltParseViewOptimizer.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/optimizers/PhannotParseAnnotationsOptimizer.php b/optimizers/PhannotParseAnnotationsOptimizer.php index a156d96448c..f4cd47d8a73 100755 --- a/optimizers/PhannotParseAnnotationsOptimizer.php +++ b/optimizers/PhannotParseAnnotationsOptimizer.php @@ -68,9 +68,12 @@ public function optimize(array $expression, Call $call, CompilationContext $cont $resolvedParams = $call->getResolvedParams($expression['parameters'], $context, $expression); - $context->codePrinter->output('if (phannot_parse_annotations(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC) == FAILURE) {'); - $context->codePrinter->output("\t" . 'RETURN_MM();'); - $context->codePrinter->output('}'); + $call->addCallStatusFlag($context); + + $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC);'); + + $call->checkTempParameters($context); + $call->addCallStatusOrJump($context); return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); } diff --git a/optimizers/PhqlParsePhqlOptimizer.php b/optimizers/PhqlParsePhqlOptimizer.php index 30ca3910a3b..20586f41412 100644 --- a/optimizers/PhqlParsePhqlOptimizer.php +++ b/optimizers/PhqlParsePhqlOptimizer.php @@ -69,7 +69,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont $call->addCallStatusFlag($context); - $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = (phql_parse_phql(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC) != FAILURE);'); + $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC);'); $call->checkTempParameters($context); $call->addCallStatusOrJump($context); diff --git a/optimizers/PhvoltParseViewOptimizer.php b/optimizers/PhvoltParseViewOptimizer.php index 7f91f0a82d3..7b8e36b3d7e 100644 --- a/optimizers/PhvoltParseViewOptimizer.php +++ b/optimizers/PhvoltParseViewOptimizer.php @@ -69,7 +69,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont $call->addCallStatusFlag($context); - $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = (phvolt_parse_view(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ' TSRMLS_CC) != FAILURE);'); + $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ' TSRMLS_CC);'); $call->checkTempParameters($context); $call->addCallStatusOrJump($context);