mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Stop generating LIR when running out of memory in the regexp compiler (471924, r=danderson).
This commit is contained in:
parent
a59109830e
commit
6a2d183fee
@ -2207,6 +2207,8 @@ class RegExpNativeCompiler {
|
||||
pos = compileFlatSingleChar(node->u.flat.chr, pos, fails);
|
||||
} else {
|
||||
for (size_t i = 0; i < node->u.flat.length; ++i) {
|
||||
if (fragment->lirbuf->outOMem())
|
||||
return JS_FALSE;
|
||||
pos = compileFlatSingleChar(((jschar*) node->kid)[i], pos, fails);
|
||||
if (!pos) break;
|
||||
}
|
||||
|
@ -108,19 +108,20 @@ namespace nanojit
|
||||
_unused = 0;
|
||||
_stats.lir = 0;
|
||||
_noMem = 0;
|
||||
_nextPage = 0;
|
||||
for (int i = 0; i < NumSavedRegs; ++i)
|
||||
savedRegs[i] = NULL;
|
||||
explicitSavedRegs = false;
|
||||
// pre-allocate the next page we will be using
|
||||
_nextPage = pageAlloc();
|
||||
NanoAssert(_nextPage || _noMem);
|
||||
}
|
||||
|
||||
void LirBuffer::rewind()
|
||||
{
|
||||
clear();
|
||||
// pre-allocate the current and the next page we will be using
|
||||
Page* start = pageAlloc();
|
||||
_unused = start ? &start->lir[0] : NULL;
|
||||
_nextPage = pageAlloc();
|
||||
NanoAssert((_unused && _nextPage) || _noMem);
|
||||
}
|
||||
|
||||
int32_t LirBuffer::insCount()
|
||||
|
Loading…
Reference in New Issue
Block a user