Closed Bug 66234 Opened 24 years ago Closed 24 years ago

[meta] Combining Regular Expression bugs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: rogerl, Assigned: rogerl)

References

Details

(Keywords: js1.5, meta)

Attachments

(3 files)

This is a bug to capture the current Reg. Exp. bugs & proposed patch rather than having to update it in all the various locations.
Status: NEW → ASSIGNED
Depends on: 57572, 57631, 61266, 61766
Attached patch Meta-mega-patch (deleted) — Splinter Review
Hmm, I reviewed the whole mega-meta-patch in bug 57572. /be
Keywords: js1.5, mozilla0.8
Keywords: meta
Attached patch Nits from 57572 applied (deleted) — Splinter Review
Attached patch Fixed more whitespace problems (deleted) — Splinter Review
rval = POP_OPND(); if (JSVAL_IS_PRIMITIVE(rval)) { + str = js_DecompileValueGenerator(cx, -1, rval, NULL); Use 0, not -1, since you just popped rval (stack grows upward, pops downward, so it's now at sp[0], not sp[-1]). Wait, that won't work: 0 is JSDVG_IGNORE_STACK, only negative indexes cause js_DecompileValueGenerator to load an operand and its generating pc. Ok, do this: rval = FETCH_OPND(-1); if (JSVAL_IS_PRIMITIVE(rval)) { + str = js_DecompileValueGenerator(cx, -1, rval, NULL); + if (str) { JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, - JSMSG_IN_NOT_OBJECT); + JSMSG_IN_NOT_OBJECT, + JS_GetStringBytes(str)); + } ok = JS_FALSE; goto out; } + sp--; Note the sp--; after the error check. Fix this, and sr=brendan@mozilla.org. /be
And pls. test in the JS shell that the error report for an invalid 'in' operator is what you expect. Try all cases for the 'in' operator that make sense. Here is a template for 'instanceof' that covers the various decompiler cases: var o = {}, O = {P:1}; o instanceof 3; o instanceof O; o instanceof Object; o instanceof O.P; var id = 'P'; o instanceof O[id]; /be
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified Fixed - ran this test suite directory on Linux, WinNT, and Mac js/tests/ecma_3/RegExp/ with both debug and optimized versions of the JS shell, and got 0 errors.
Status: RESOLVED → VERIFIED
Keywords: mozilla0.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: