mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 931912 - Suppress an exact rooting hazard false positive in nsWindowSH::Finalize; r=sfink
--HG-- extra : rebase_source : 3934e7cd7e21e37de20aadac203db6a285021691
This commit is contained in:
parent
99ef56df98
commit
2bd8f8f148
@ -3651,6 +3651,14 @@ NS_IMETHODIMP
|
||||
nsWindowSH::Finalize(nsIXPConnectWrappedNative *wrapper, JSFreeOp *fop,
|
||||
JSObject *obj)
|
||||
{
|
||||
// Since this call is virtual, the exact rooting hazard static analysis is
|
||||
// not able to determine that it happens during finalization and should be
|
||||
// ignored. Moreover, the analysis cannot discover and validate the
|
||||
// potential targets of the virtual call to OnFinalize below because of the
|
||||
// indirection through nsCOMMPtr. Thus, we annotate the analysis here so
|
||||
// that it does not report OnFinalize as GCing with |obj| on stack.
|
||||
JS::AutoAssertNoGC nogc;
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryWrappedNative(wrapper));
|
||||
NS_ENSURE_TRUE(sgo, NS_ERROR_UNEXPECTED);
|
||||
|
||||
|
@ -213,13 +213,18 @@ WasIncrementalGC(JSRuntime *rt);
|
||||
extern JS_FRIEND_API(size_t)
|
||||
GetGCNumber();
|
||||
|
||||
class AutoAssertNoGC {
|
||||
class JS_PUBLIC_API(AutoAssertNoGC)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
size_t gcNumber;
|
||||
|
||||
public:
|
||||
AutoAssertNoGC();
|
||||
~AutoAssertNoGC();
|
||||
#else
|
||||
public:
|
||||
/* Prevent unreferenced local warnings in opt builds. */
|
||||
AutoAssertNoGC() {}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user