diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index cac3a68f058..3d35a04d0bc 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -3297,8 +3297,10 @@ TraceRecorder::record_JSOP_RETURN() jsval& rval = stackval(-1); JSStackFrame *fp = cx->fp; if (cx->fp->flags & JSFRAME_CONSTRUCTING) { - JS_ASSERT(OBJECT_TO_JSVAL(fp->thisp) == fp->argv[-1]); - rval_ins = get(&fp->argv[-1]); + if (JSVAL_IS_PRIMITIVE(rval)) { + JS_ASSERT(OBJECT_TO_JSVAL(fp->thisp) == fp->argv[-1]); + rval_ins = get(&fp->argv[-1]); + } } else { rval_ins = get(&rval); }