unexpected minimumInputSize in setupDisjunctionOffsets for regexp engine(yarr)
https://bugs.webkit.org/show_bug.cgi?id=220357
Reviewed by Saam Barati.
JSTests:
New tests to check the boundary conditions for overflowing a pattern in a RegExp.
- stress/regexp-max-size.js: Added.
(testMaxRegExp):
(testTooBigRegExp):
(testMaxBMPRegExp):
(testTooBigBMPRegExp):
(testMaxNonBMPRegExp):
(testTooBigNonBMPRegExp):
(testAll):
Source/JavaScriptCore:
Removed an unnecessary ASSERT.
This assert checked that the minimum size wasn't UINT_MAX which I believe was
intended to make sure the minimum size was changed while computing the
disjunction's size and offsets. Those calculations involve checked arithmetic,
which would catch any overflow.
The other part of this patch adds a test that checks this condition as well
as the case where the pattern is one character longer, 232, which triggers
the arithmetic overflow.
(JSC::Yarr::YarrPatternConstructor::setupDisjunctionOffsets):