Resolves out of memory error when consecutive numeric separators follow a binary/hex literal.
(cmb, Nikita)
. Fixed bug #78441 (Parse error due to heredoc identifier followed by digit).
(cmb)
+ . Fixed bug #78454 (Consecutive numeric separators cause OOM error).
+ (Theodore Brown)
- SPL:
. Fixed bug #78436 (Missing addref in SplPriorityQueue EXTR_BOTH mode).
--- /dev/null
+--TEST--
+Invalid consecutive numeric separators after hex literal
+--FILE--
+<?php
+0x0__F;
+--EXPECTF--
+Parse error: syntax error, unexpected '__F' (T_STRING) in %s on line %d
--- /dev/null
+--TEST--
+Invalid consecutive numeric separators after binary literal
+--FILE--
+<?php
+0b0__1
+--EXPECTF--
+Parse error: syntax error, unexpected '__1' (T_STRING) in %s on line %d
char *end, *bin = yytext + 2;
/* Skip any leading 0s */
- while (*bin == '0' || *bin == '_') {
+ while (len > 0 && (*bin == '0' || *bin == '_')) {
++bin;
--len;
}
char *end, *hex = yytext + 2;
/* Skip any leading 0s */
- while (*hex == '0' || *hex == '_') {
+ while (len > 0 && (*hex == '0' || *hex == '_')) {
++hex;
--len;
}