Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser.Parse hangs up #107

Closed
vasileknik76 opened this issue Jun 8, 2020 · 1 comment
Closed

parser.Parse hangs up #107

vasileknik76 opened this issue Jun 8, 2020 · 1 comment

Comments

@vasileknik76
Copy link

vasileknik76 commented Jun 8, 2020

I have run parse with following PHP code:

<?php

$foo = 5;

echo "$foo$";

and parser hangs up. Debug output:

reduce 80 in:
        state-0
char tok--1 in state-2
lex T_VARIABLE(57354)
char tok--1 in state-107
reduce 441 in:
        state-107
char tok--1 in state-80
reduce 432 in:
        state-80
char tok--1 in state-48
lex '='(61)
reduce 438 in:
        state-48
char '=' in state-44
char tok--1 in state-203
lex T_LNUMBER(57350)
char tok--1 in state-94
reduce 402 in:
        state-94
char tok--1 in state-72
reduce 364 in:
        state-72
char tok--1 in state-45
reduce 422 in:
        state-45
char tok--1 in state-392
lex ';'(59)
reduce 298 in:
        state-392
char ';' in state-45
reduce 422 in:
        state-45
char ';' in state-28
char tok--1 in state-154
reduce 146 in:
        state-154
char tok--1 in state-5
reduce 87 in:
        state-5
char tok--1 in state-3
reduce 79 in:
        state-3
char tok--1 in state-2
lex T_ECHO(57361)
char tok--1 in state-26
lex '"'(34)
char tok--1 in state-105
lex T_VARIABLE(57354)
char tok--1 in state-259
@z7zmey
Copy link
Owner

z7zmey commented Jun 14, 2020

Hi @vasileknik76.
I have solved this bug. It was due to the scanner getting to infinite loop when $ appear between a variable and the end of a template string.

@z7zmey z7zmey closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants