mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Fix js_AllocStack to null new space (cheapest way to save last-ditch GC from scanning uninitialized stack space; 290476, r=shaver, a=me).
This commit is contained in:
parent
20572e768b
commit
743092df0c
@ -407,6 +407,12 @@ js_AllocStack(JSContext *cx, uintN nslots, void **markp)
|
||||
sp += 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Store JSVAL_NULL using memset, to let compilers optimize as they see
|
||||
* fit, in case a caller allocates and pushes GC-things one by one, which
|
||||
* could nest a last-ditch GC that will scan this segment.
|
||||
*/
|
||||
memset(sp, 0, nslots * sizeof(jsval));
|
||||
return sp;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user