From 9984844600dabb1c21cb45b2b1cdac6806f56d59 Mon Sep 17 00:00:00 2001 From: Andrea Faulds Date: Thu, 16 Oct 2014 00:20:01 +0100 Subject: [PATCH] Fixed bug causing incorrectly numbered labels for jumpz in PHP backend --- lib/ReckiCT/Compiler/PHP/Compiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ReckiCT/Compiler/PHP/Compiler.php b/lib/ReckiCT/Compiler/PHP/Compiler.php index 0604d16..c0fba97 100644 --- a/lib/ReckiCT/Compiler/PHP/Compiler.php +++ b/lib/ReckiCT/Compiler/PHP/Compiler.php @@ -133,7 +133,7 @@ public function compileInstruction(array $instruction, \StdClass $ctx) $var = $ctx->scope[$instruction[1]]; if (!isset($ctx->labels[$instruction[2]])) { - $ctx->labels[$instruction[2]] = 'label_' . (count($ctx->labels) + 2); + $ctx->labels[$instruction[2]] = 'label_' . (count($ctx->labels) + 1); } $ctx->function .= "if (!" . $var . ") { goto " . $ctx->labels[$instruction[2]] . "; }\n";