Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Out of bounds array access in Regexp #21

Open
GoogleCodeExporter opened this issue Apr 11, 2015 · 0 comments
Open

Out of bounds array access in Regexp #21

GoogleCodeExporter opened this issue Apr 11, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The Regexp benchmark has an out-of-bounds error that results in checking 
whether "undefined" matches some regular expression. The problem is that the 
arrays s45 and s46 have a different length, but they are always used together, 
assuming that their lengths are the same. As a result, line 77 passes 
"undefined" to RegExp.exec(), which results in an array that contains the 
string "undefined" multiple times.

The problem doesn't crash the benchmark but it's doing a nonsense computation. 
To fix the problem, just change the number of variants in one of the two arrays 
s45 and s46, so that they have the same length.

Attached is a patch with a fix. 

Original issue reported on code.google.com by [email protected] on 5 Jun 2014 at 4:33

Attachments:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant