diff --git a/tools/fuzzing/target.php b/tools/fuzzing/target.php index 8cbd619c16..7638af23c7 100644 --- a/tools/fuzzing/target.php +++ b/tools/fuzzing/target.php @@ -104,7 +104,7 @@ public function leaveNode(PhpParser\Node $node) { $stmts = $parser->parse($input); $printed = $prettyPrinter->prettyPrintFile($stmts); - $visitor->setTokens($lexer->getTokens()); + $visitor->setTokens($parser->getTokens()); $stmts = $traverser->traverse($stmts); if ($visitor->hasProblematicConstruct) { return; @@ -116,7 +116,7 @@ public function leaveNode(PhpParser\Node $node) { throw new Error("Failed to parse pretty printer output"); } - $visitor->setTokens($lexer->getTokens()); + $visitor->setTokens($parser->getTokens()); $printedStmts = $traverser->traverse($printedStmts); $same = $nodeDumper->dump($stmts) == $nodeDumper->dump($printedStmts); if (!$same && !preg_match('/<\?php<\?php/i', $input)) {