Bug 1013658 - Handle null ScriptSource in AutoFilename::get (r=bholley)
authorLuke Wagner <luke@mozilla.com>
Tue, 20 May 2014 21:12:23 -0500
changeset 184053 9f960ed46a1d4d9496a2a326f5831933aa6f1b1c
parent 184052 cf53e366410feb1c5baa58182c62cb82a3aa6592
child 184054 aa35d4e17c822c4eeecfd665af54b86d67d57376
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1013658
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1013658 - Handle null ScriptSource in AutoFilename::get (r=bholley)
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6377,18 +6377,17 @@ AutoFilename::reset(void *newScriptSourc
     if (scriptSource_)
         reinterpret_cast<ScriptSource*>(scriptSource_)->decref();
     scriptSource_ = newScriptSource;
 }
 
 const char *
 AutoFilename::get() const
 {
-    JS_ASSERT(scriptSource_);
-    return reinterpret_cast<ScriptSource*>(scriptSource_)->filename();
+    return scriptSource_ ? reinterpret_cast<ScriptSource*>(scriptSource_)->filename() : nullptr;
 }
 
 JS_PUBLIC_API(bool)
 DescribeScriptedCaller(JSContext *cx, AutoFilename *filename, unsigned *lineno)
 {
     if (lineno)
         *lineno = 0;