Closed Bug 554203 Opened 16 years ago Closed 16 years ago

dead code in JSOP_STOP

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Assigned: luke)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

JSOP_STOP contains the test: if ((regs.f.p->flags & JSFRAME_CONSTRUCTING) && JSVAL_IS_PRIMITIVE(regs.f.p->rval)) { if (!regs.f.p->fun) { JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_NEW_RESULT, js_ValueToPrintableString(cx, rval)); goto error; } It doesn't seem to be possible to have a constructor call that has fp->fun == NULL, in which case the inner test can be removed. If, for some arcane reason, this is possible, then I think the use of 'rval' should be 'fp->rval'.
Oh, I forgot, this code was introduced for bug 453462.
I did the hg archeology, and of course I'm blamed for the r+ on Andreas's patch for bug 453462. It seems the rval clamping (primitive trumped by |this| for a ctor) is good but not the if (!fp->fun) error return case. I should have caught that then. /be
Attached patch remove — — Splinter Review
Assignee: general → lw
Status: NEW → ASSIGNED
Attachment #434165 - Flags: review?(brendan)
Comment on attachment 434165 [details] [diff] [review] remove Looks like you can pull the if condition's overflow line up so it fits on one line and eliminate the braces. /be
Attachment #434165 - Flags: review?(brendan) → review+
Whiteboard: fixed-in-tracemonkey
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: