forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-sync with internal repository (facebook#856)
Co-authored-by: Facebook Community Bot <[email protected]>
- Loading branch information
1 parent
85613e1
commit 1eb8f7e
Showing
3 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: %hermes -O %s | ||
|
||
// Check Regex doesn't crash due to an underlying unitialized propStorage_. | ||
// There was a bug that the hidden class of the named capture group mapping | ||
// object would not have a properly initialized propStorage_. | ||
// Thus, once the number of named groups exceeded the number of direct | ||
// property slots, it crashed when trying to assign properties to | ||
// the uninitialized propStorage_. | ||
|
||
var s = ''; | ||
for (let i = 0; i < 1000; i++) { | ||
s += `(?<foo${i}>a)`; | ||
} | ||
var re = new RegExp(s); | ||
print(re.exec("")) |