Closed Bug 274888 Opened 20 years ago Closed 20 years ago

Negative lookahead does not match at positions > approx. 64k

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8beta2

People

(Reporter: sjoerd, Assigned: mrbkap)

Details

(Keywords: js1.5)

Attachments

(1 file)

This is probably a known limitation of the current implementation. I just
couldn't find it documented anywhere. 

If it is not a limitation but a bug I will create a test case.
This is related to bug 280769.  The bytecoded NFA rogerl implemented to get back
the perf lost when the old 4.x-era NFA was replaced with a tree-walker for
ECMA-262 Edition 3 uses only two-byte immediate offsets in its bytecode.  Jumps
therefore go from -32768 to +32767, but I'm guessing that certain assertions
have unsigned offsets.

Cc'ing some folks who might take this bug (mrbkap, I hope -- I'll advise).

/be
Keywords: js1.5
QA Contact: pschwartau → moz
Taking, but a testcase would be nice.
Assignee: general → mrbkap
js/tests/js1_5/Regress/regress-274888.js checked in.
Unless someone has an issue with it, I'm going to make a patch that has
REProgState hold a pointer to the buffer instead of an index (which can
overflow) sometime tomorrow. Brendan, is there a reason this wasn't done from
the start?
Status: NEW → ASSIGNED
mrbkap: don't use a pointer, or you'll have to recompute it on every realloc or
moral equivalent (JS_ARENA_GROW*).  Just fix the type of REProgState::index to
be ptrdiff_t, ok?  Thanks for figuring this out, it's nice and easy.

/be
Attachment #175695 - Flags: review?(brendan)
Comment on attachment 175695 [details] [diff] [review]
Use the correct types for indices

r=me, thanks again!

/be
Attachment #175695 - Flags: review?(brendan) → review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta2
Flags: testcase+
verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: