Fix #61095 (Lexing 0x0*+<NUM> incorrectly)

This commit is contained in:
Etienne Kneuss 2012-02-20 18:28:57 +00:00
parent 1800baf4c2
commit c51f737994
4 changed files with 203 additions and 186 deletions

9
Zend/tests/bug61095.phpt Normal file
View File

@ -0,0 +1,9 @@
--TEST--
Bug #61095 (Lexing 0x00*+<NUM> incorectly)
--FILE--
<?php
echo 0x00+2;
echo "\n";
?>
--EXPECT--
2

File diff suppressed because it is too large Load Diff

View File

@ -1523,7 +1523,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
zendlval->value.lval = strtol(hex, NULL, 16);
if (len == 0) {
zendlval->value.lval = 0;
} else {
zendlval->value.lval = strtol(hex, NULL, 16);
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Mon Jan 16 14:45:55 2012 */
/* Generated by re2c 0.13.5 on Wed Feb 15 17:48:20 2012 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {