Closed Bug 483821 Opened 17 years ago Closed 17 years ago

TM: Unexpected result when using "\x7e" to represent a character in a string

Categories

(Core :: JavaScript Engine, defect)

1.9.1 Branch
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.9.2a1

People

(Reporter: bit, Assigned: dmandelin)

References

Details

(Keywords: verified1.9.1)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 (.NET CLR 3.5.30729) I am using regular expressions to replace certain characters in a string. When using FF 3.1b3 with javascript.options.jit.content set to true, the output is not correct. Reproducible: Always Steps to Reproduce: var re1 = new RegExp("\\x25","gi"); var re2 = new RegExp("\\x7e","gi"); var re3 = new RegExp("\~","gi"); alert("~%".match(re1));//alerts % alert("~%".match(re2));//should alert ~, instead alerts % alert("~%".match(re3));//alerts ~ Actual Results: alerted %, %, and ~ Expected Results: alerted %, ~, and ~ setting javascript.options.jit.content to false fixes this problem.
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Summary: Unexpected result when using "/x7e" to represent a character in a string → TM: Unexpected result when using "/x7e" to represent a character in a string
Version: unspecified → 1.9.1 Branch
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.9.1?
Flags: blocking1.9.1? → blocking1.9.1+
Attached patch PatchSplinter Review
Key compare was busted because it compared the first n bytes instead of the first n chars of the regexp source text.
Assignee: general → dmandelin
Status: NEW → ASSIGNED
Attachment #367921 - Flags: review?(gal)
Attachment #367921 - Flags: review?(gal) → review+
Pushed to TM as c923f9ce63ee.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Please add a regression test!
Flags: in-testsuite?
As given by the duped bug 483270 this will probably affect several websites. Raising severity to major.
Severity: normal → major
OS: Windows XP → All
Hardware: x86 → All
Target Milestone: --- → mozilla1.9.2a1
Summary: TM: Unexpected result when using "/x7e" to represent a character in a string → TM: Unexpected result when using "\x7e" to represent a character in a string
Verified on trunk and 1.9.1 with following builds: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090519 Minefield/3.6a1pre Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090519 Shiretoko/3.5b5pre ID:20090519035556
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: