jscript: Throw proper error for out of memory conditions in RegExp.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
parent
e7b06b0ddd
commit
c0e8f1669f
1 changed files with 4 additions and 7 deletions
|
@ -45,8 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
|
|||
#define ReportRegExpErrorHelper(a,b,c,d) throw_error((a)->context, E_FAIL, L"")
|
||||
#define JS_ReportErrorNumber(a,b,c,d) throw_error((a), E_FAIL, L"")
|
||||
#define JS_ReportErrorFlagsAndNumber(a,b,c,d,e,f) throw_error((a), E_FAIL, L"")
|
||||
#define js_ReportOutOfScriptQuota(a) throw_error((a), E_FAIL, L"")
|
||||
#define JS_ReportOutOfMemory(a) throw_error((a), E_FAIL, L"")
|
||||
#define JS_COUNT_OPERATION(a,b) throw_error((a), E_FAIL, L"")
|
||||
|
||||
|
||||
|
@ -412,7 +410,7 @@ NewRENode(CompilerState *state, REOp op)
|
|||
|
||||
ren = heap_pool_alloc(state->pool, sizeof(*ren));
|
||||
if (!ren) {
|
||||
/* js_ReportOutOfScriptQuota(cx); */
|
||||
throw_error(state->context, E_OUTOFMEMORY, L"");
|
||||
return NULL;
|
||||
}
|
||||
ren->op = op;
|
||||
|
@ -1944,7 +1942,7 @@ PushBackTrackState(REGlobalData *gData, REOp op,
|
|||
btincr = ((btincr+btsize-1)/btsize)*btsize;
|
||||
gData->backTrackStack = heap_pool_grow(gData->pool, gData->backTrackStack, btsize, btincr);
|
||||
if (!gData->backTrackStack) {
|
||||
js_ReportOutOfScriptQuota(gData->cx);
|
||||
throw_error(gData->cx, E_OUTOFMEMORY, L"");
|
||||
gData->ok = FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2112,7 +2110,7 @@ ProcessCharSet(REGlobalData *gData, RECharSet *charSet)
|
|||
byteLength = (charSet->length >> 3) + 1;
|
||||
charSet->u.bits = malloc(byteLength);
|
||||
if (!charSet->u.bits) {
|
||||
JS_ReportOutOfMemory(gData->cx);
|
||||
throw_error(gData->cx, E_OUTOFMEMORY, L"");
|
||||
gData->ok = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -2300,7 +2298,7 @@ ReallocStateStack(REGlobalData *gData)
|
|||
|
||||
gData->stateStack = heap_pool_grow(gData->pool, gData->stateStack, sz, sz);
|
||||
if (!gData->stateStack) {
|
||||
js_ReportOutOfScriptQuota(gData->cx);
|
||||
throw_error(gData->cx, E_OUTOFMEMORY, L"");
|
||||
gData->ok = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -3131,7 +3129,6 @@ static HRESULT InitMatch(regexp_t *re, void *cx, heap_pool_t *pool, REGlobalData
|
|||
return S_OK;
|
||||
|
||||
bad:
|
||||
js_ReportOutOfScriptQuota(cx);
|
||||
gData->ok = FALSE;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue