Bug 1326096 followup. Suppress the false-positive GC analysis failure due to us doing an indirect call that the static analysis doesn't understand. r=sfink

This commit is contained in:
Boris Zbarsky
2016-12-29 14:00:43 -08:00
parent fced0d6848
commit 01786f18a4
3 changed files with 11 additions and 1 deletions

View File

@@ -74,6 +74,7 @@
#include "mozilla/dom/ScriptSettings.h"
#include "jsprf.h"
#include "js/Debug.h"
#include "js/GCAPI.h"
#include "nsContentUtils.h"
#include "nsCycleCollectionNoteRootCallback.h"
#include "nsCycleCollectionParticipant.h"
@@ -923,6 +924,9 @@ CycleCollectedJSContext::LargeAllocationFailureCallback(void* aData)
CycleCollectedJSContext::SizeofExternalStringCallback(JSString* aStr,
MallocSizeOf aMallocSizeOf)
{
// We promised the JS engine we would not GC. Enforce that:
JS::AutoCheckCannotGC autoCannotGC;
if (!XPCStringConvert::IsDOMString(aStr)) {
// Might be a literal or something we don't understand. Just claim 0.
return 0;