From 4f79e0b92f4269609ce7d0fad18dd41991d533c7 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Thu, 22 Dec 2011 18:17:06 -0500 Subject: [PATCH] Make various returns in jsopcode.cpp properly return NULL rather than false. Followup to bug 692274, r=themaid --- js/src/jsopcode.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index 0bda5f52dd40..066301981169 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -3348,11 +3348,11 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) */ Vector rhsExprs(cx); if (!rhsExprs.resize(atoms.length())) - return false; + return NULL; for (size_t i = 0; i < rhsExprs.length(); ++i) { rhsExprs[i] = GetStr(ss, letDepth + i); if (!rhsExprs[i]) - return false; + return NULL; } /* Build the let head starting at headBegin. */ @@ -3364,15 +3364,15 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) */ if (groupAssign) { if (Sprint(&ss->sprinter, "[") < 0) - return false; + return NULL; for (size_t i = 0; i < atoms.length(); ++i) { if (i && Sprint(&ss->sprinter, ", ") < 0) - return false; + return NULL; if (!QuoteString(&ss->sprinter, atoms[i], 0)) - return false; + return NULL; } if (Sprint(&ss->sprinter, "] = [") < 0) - return false; + return NULL; } for (size_t i = 0; i < atoms.length(); ++i) { @@ -3381,31 +3381,31 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) continue; if (i && Sprint(&ss->sprinter, ", ") < 0) - return false; + return NULL; if (groupAssign) { if (SprintCString(&ss->sprinter, rhs) < 0) - return false; + return NULL; } else if (!strncmp(rhs, DestructuredString, DestructuredStringLength)) { if (SprintCString(&ss->sprinter, rhs + DestructuredStringLength) < 0) - return false; + return NULL; } else { JS_ASSERT(atoms[i] != cx->runtime->atomState.emptyAtom); if (!QuoteString(&ss->sprinter, atoms[i], 0)) - return false; + return NULL; if (*rhs) { uint8_t prec = js_CodeSpec[ss->opcodes[letDepth + i]].prec; const char *fmt = prec && prec < js_CodeSpec[JSOP_SETLOCAL].prec ? " = (%s)" : " = %s"; if (Sprint(&ss->sprinter, fmt, rhs) < 0) - return false; + return NULL; } } } if (groupAssign && Sprint(&ss->sprinter, "]") < 0) - return false; + return NULL; /* Clone the let head chars before clobbering the stack. */ DupBuffer head(cx);