RegExp with flag explicitly set to undefined causes segfault

VERIFIED FIXED

Status

()

Core
JavaScript Engine
P3
normal
VERIFIED FIXED
17 years ago
16 years ago

People

(Reporter: Phil Schwartau, Assigned: rogerl (gone))

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
RegExp('matchthis', undefined);
RegExp('matchthis', 'undefined');

var re = new RegExp('matchthis', undefined);
var re = new RegExp('matchthis', 'undefined');


All of these currently cause a segfault in JS Engine. My understanding is 
that per ECMA, passing undefined as the 2nd parameter should be equivalent
to not providing the parameter at all.

I don't know about passing the string 'undefined' - it seems to me it
should be treated as an invalid flag value (e.g. like passing 'a' as a flag). 
Or should it be the same as passing the value undefined? 

At any rate, it shouldn't segfault -
(Assignee)

Updated

17 years ago
Blocks: 66234
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

17 years ago
Generated a meta bug to capture all current R.E. bugs.
(Assignee)

Comment 2

17 years ago
Fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Reporter)

Comment 3

17 years ago
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
You need to log in before you can comment on or make changes to this bug.