google / google/benchmark

[FR] Support RE2 regular expression engine

Open
#1,650 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

**Is your feature request related to a problem? Please describe.**
When given an invalid regular expression, Chromium perftests using this library crash.

This is because Chromium compiles google_benchmark with `std::regex` and with exceptions disabled, and so there's no way for it to recover from a regular expression parsing error.

**Describe the solution you'd like**
When given an invalid regular expression, an error should be reported and no benchmarks should be run.

The Chromium project already incorporates the re2 regular expression library, so if it was possible for the embedder to provide the re2 engine then this problem could be solved.

**Describe alternatives you've considered**
Chromium could use the POSIX regex library, but it wouldn't work on Windows. Chromium could use the POSIX regex library on non-Windows platforms, but then behaviour would differ between platforms, which causes a lot of problems.

**Additional context**
N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.