ICU-21492 Fix regex compile assertion failure.

A regex pattern containing nested look-behind blocks could trigger an assertion
failure during pattern compilation. The problem was caused by an off-by-one
error in the code that computes an upper bound on the match length, needed
because look-behind expressions are constrained to not have unbounded match

Nested look-behind blocks come into play because, when computing the maximum
match length of an outer block, any inner look-behind blocks are skipped over -
they do not directly contribute to the length matched by the outer block. The
problem was in the code that skips over these nested look-behind blocks.
2 files changed
tree: b4145973f8d8a4d897d6b06151f6710fd325af2f
  1. .ci-builds/
  2. .github/
  3. docs/
  4. icu4c/
  5. icu4j/
  6. tools/
  7. vendor/
  8. .appveyor.yml
  9. .cpyskip.txt
  10. .gitattributes
  11. .gitignore
  12. KEYS

International Components for Unicode

This is the repository for the International Components for Unicode. The ICU project is under the stewardship of The Unicode Consortium.

ICU Logo

Build Status (master branch)

TravisCIBuild Status
Azure PipelinesBuild Status
Azure Pipelines (Exhaustive Tests)Build Status
Azure Pipelines (Valgrind ICU4C)Build Status
AppVeyorBuild status
FuzzingFuzzing Status

Subdirectories and Information


Please see ./icu4c/LICENSE (C and J are under an identical license file.)

Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. Terms of Use and License