diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2015-07-26 22:57:12 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2015-07-26 22:57:30 +0200 |
| commit | 70c6a6f624ec07be37ce90424d0765e3c78d1bf5 (patch) | |
| tree | 6bf73d630b13d77f5fc0a7ee1c86b05df7a27080 /sapi/phpdbg/phpdbg_lexer.l | |
| parent | 4cf9011c626e8920beed95bab49284de13dc4459 (diff) | |
| download | php-git-70c6a6f624ec07be37ce90424d0765e3c78d1bf5.tar.gz | |
Fix infinite lexer loop for :\ sequence in phpdbg
Diffstat (limited to 'sapi/phpdbg/phpdbg_lexer.l')
| -rw-r--r-- | sapi/phpdbg/phpdbg_lexer.l | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index 7fca70f57a..35ca744400 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -60,6 +60,7 @@ T_RUN_SHORT "r" WS [ \r\n\t]+ DIGITS [-]?[0-9\.]+ ID [^ \r\n\t:#\000]+ +GENERIC_ID ([^ \r\n\t:#\000]|":\\")+ ADDR [0][x][a-fA-F0-9]+ OPCODE (ZEND_|zend_)([A-Za-z])+ INPUT [^\n\000]+ @@ -70,7 +71,7 @@ INPUT [^\n\000]+ return 0; } -<PRE_RAW, NORMAL>[-][r]{WS}?{DIGITS} { +<PRE_RAW, NORMAL>"-r"{WS}?{DIGITS} { char *text = yytext + 2; while (*++text < '0'); yylval->num = atoi(text); @@ -83,22 +84,23 @@ INPUT [^\n\000]+ return T_IF; } -<NORMAL>{ID}[:]{1}[//]{2} { - phpdbg_init_param(yylval, STR_PARAM); - yylval->str = zend_strndup(yytext, yyleng); - yylval->len = yyleng; - return T_PROTO; -} -<NORMAL>[#]{1} { +<NORMAL>"#" { return T_POUND; } -<NORMAL>[:]{2} { +<NORMAL>"::" { return T_DCOLON; } -<NORMAL>[:]{1}/[^\\] { +<NORMAL>":"/[^\\] { return T_COLON; } +<NORMAL>{ID}"://" { + phpdbg_init_param(yylval, STR_PARAM); + yylval->str = zend_strndup(yytext, yyleng); + yylval->len = yyleng; + return T_PROTO; +} + <NORMAL>({T_YES}|{T_ON}|{T_ENABLED}|{T_TRUE}){WS} { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 1; @@ -130,7 +132,7 @@ INPUT [^\n\000]+ return T_OPCODE; } -<NORMAL>{ID} { +<NORMAL>{GENERIC_ID} { phpdbg_init_param(yylval, STR_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; |
