mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1503722: Check for null in JSScript::freeScriptData r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D11472 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
fe0e9340b4
commit
9c33f619f8
10
js/src/jit-test/tests/xdr/bug1503722.js
Normal file
10
js/src/jit-test/tests/xdr/bug1503722.js
Normal file
@ -0,0 +1,10 @@
|
||||
// |jit-test| skip-if: !('oomAtAllocation' in this) || helperThreadCount() === 0
|
||||
|
||||
let THREAD_TYPE_PARSE = 4;
|
||||
let t = cacheEntry("function f() { function g() { }; return 3; };");
|
||||
evaluate(t, { sourceIsLazy: true, saveIncrementalBytecode: true });
|
||||
for (var i = 1; i < 20; ++i) {
|
||||
oomAtAllocation(i, THREAD_TYPE_PARSE);
|
||||
offThreadDecodeScript(t);
|
||||
gc();
|
||||
}
|
@ -2814,8 +2814,10 @@ JSScript::createSharedScriptData(JSContext* cx, uint32_t codeLength,
|
||||
void
|
||||
JSScript::freeScriptData()
|
||||
{
|
||||
scriptData_->decRefCount();
|
||||
scriptData_ = nullptr;
|
||||
if (scriptData_) {
|
||||
scriptData_->decRefCount();
|
||||
scriptData_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user