mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 895660 - Detect LinkBuffer OOM. r=nbp
This commit is contained in:
parent
8c30d76bc7
commit
f3411c98be
@ -192,6 +192,11 @@ public:
|
||||
return CodeLocationLabel(code());
|
||||
}
|
||||
|
||||
// Useful as a proxy to detect OOM.
|
||||
void* unsafeCode() {
|
||||
return code();
|
||||
}
|
||||
|
||||
protected:
|
||||
// Keep this private! - the underlying code should only be obtained externally via
|
||||
// finalizeCode() or finalizeCodeAddendum().
|
||||
|
@ -2688,10 +2688,16 @@ public:
|
||||
backtrack();
|
||||
|
||||
// Link & finalize the code.
|
||||
// XXX yarr-oom
|
||||
ExecutablePool *pool;
|
||||
bool ok;
|
||||
LinkBuffer linkBuffer(this, globalData->regexAllocator, &pool, &ok, REGEXP_CODE);
|
||||
|
||||
// Attempt to detect OOM during linkBuffer creation.
|
||||
if (linkBuffer.unsafeCode() == nullptr) {
|
||||
jitObject.setFallBack(true);
|
||||
return;
|
||||
}
|
||||
|
||||
m_backtrackingState.linkDataLabels(linkBuffer);
|
||||
|
||||
if (compileMode == MatchOnly) {
|
||||
|
Loading…
Reference in New Issue
Block a user