mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Fix #61095 (Lexing 0x0*+<NUM> incorrectly)
This commit is contained in:
parent
1800baf4c2
commit
c51f737994
9
Zend/tests/bug61095.phpt
Normal file
9
Zend/tests/bug61095.phpt
Normal 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
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user