зеркало из https://github.com/mozilla/pjs.git
Bug 375876 - "Assertion failure: (c2 <= cs->length) && (c1 <= c2)" with /[\[-h]/i, r=mrbkap, a=blocking1.9
This commit is contained in:
Родитель
f8cd5eb378
Коммит
cf3e6e344e
|
@ -916,7 +916,9 @@ CalculateBitmapSize(CompilerState *state, RENode *target, const jschar *src,
|
|||
}
|
||||
|
||||
while (src != end) {
|
||||
JSBool canStartRange = JS_TRUE;
|
||||
uintN localMax = 0;
|
||||
|
||||
switch (*src) {
|
||||
case '\\':
|
||||
++src;
|
||||
|
@ -971,6 +973,7 @@ lexHex:
|
|||
localMax = n;
|
||||
break;
|
||||
case 'd':
|
||||
canStartRange = JS_FALSE;
|
||||
if (inRange) {
|
||||
JS_ReportErrorNumber(state->context,
|
||||
js_GetErrorMessage, NULL,
|
||||
|
@ -984,6 +987,7 @@ lexHex:
|
|||
case 'S':
|
||||
case 'w':
|
||||
case 'W':
|
||||
canStartRange = JS_FALSE;
|
||||
if (inRange) {
|
||||
JS_ReportErrorNumber(state->context,
|
||||
js_GetErrorMessage, NULL,
|
||||
|
@ -1053,7 +1057,7 @@ lexHex:
|
|||
}
|
||||
inRange = JS_FALSE;
|
||||
} else {
|
||||
if (src < end - 1) {
|
||||
if (canStartRange && src < end - 1) {
|
||||
if (*src == '-') {
|
||||
++src;
|
||||
inRange = JS_TRUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче