Bug 1360152 - null-check correct value in ToDisassemblySource; r?froydnj
MozReview-Commit-ID: 3HR4ZofDlyW
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1180,17 +1180,17 @@ ToDisassemblySource(JSContext* cx, Handl
if (v.isString()) {
Sprinter sprinter(cx);
if (!sprinter.init())
return false;
char* nbytes = QuoteString(&sprinter, v.toString(), '"');
if (!nbytes)
return false;
UniqueChars copy = JS_smprintf("%s", nbytes);
- if (!nbytes) {
+ if (!copy) {
ReportOutOfMemory(cx);
return false;
}
bytes->initBytes(Move(copy));
return true;
}
if (JS::CurrentThreadIsHeapBusy() || !cx->isAllocAllowed()) {