Merge branch 'github_develop' into github_master

This commit is contained in:
Hong, Yang A 2019-10-30 15:23:56 +00:00
commit d79973efb1
5 changed files with 38 additions and 6 deletions

View File

@ -2,6 +2,11 @@
This is a list of notable changes to Hyperscan, in reverse chronological order.
## [5.2.1] 2019-10-13
- Bugfix for issue #186: fix compile issue when `BUILD_SHARED_LIBS` is on in
release mode.
- Disable redundant move check for older compiler versions.
## [5.2.0] 2019-07-12
- Literal API: add new API `hs_compile_lit()` and `hs_compile_lit_multi()` to
process pure literal rule sets. The 2 literal APIs treat each expression text

View File

@ -3,7 +3,7 @@ project (hyperscan C CXX)
set (HS_MAJOR_VERSION 5)
set (HS_MINOR_VERSION 2)
set (HS_PATCH_VERSION 0)
set (HS_PATCH_VERSION 1)
set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION})
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
@ -395,6 +395,12 @@ if (CXX_IGNORED_ATTR)
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-ignored-attributes")
endif()
# gcc 9 complains about redundant move for returned variable
CHECK_CXX_COMPILER_FLAG("-Wredundant-move" CXX_REDUNDANT_MOVE)
if (CXX_REDUNDANT_MOVE)
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-redundant-move")
endif()
# note this for later
# g++ doesn't have this flag but clang does
CHECK_CXX_COMPILER_FLAG("-Wweak-vtables" CXX_WEAK_VTABLES)

View File

@ -613,8 +613,9 @@ When an expression has the :c:member:`HS_FLAG_COMBINATION` flag set, it ignores
all other flags except the :c:member:`HS_FLAG_SINGLEMATCH` flag and the
:c:member:`HS_FLAG_QUIET` flag.
Hyperscan will reject logical combination expressions at compile time that
evaluate to *true* when no patterns have matched; for example: ::
Hyperscan will accept logical combination expressions at compile time that
evaluate to *true* when no patterns have matched, and report the match for
combination at end of data if no patterns have matched; for example: ::
!101
!101|102

View File

@ -414,6 +414,7 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
hs_compile_error_t *compile_err;
Timer timer;
#ifndef RELEASE_BUILD
if (useLiteralApi) {
// Pattern length computation should be done before timer start.
vector<size_t> lens(count);
@ -434,6 +435,26 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
grey);
timer.complete();
}
#else
if (useLiteralApi) {
// Pattern length computation should be done before timer start.
vector<size_t> lens(count);
for (unsigned int i = 0; i < count; i++) {
lens[i] = strlen(patterns[i]);
}
timer.start();
err = hs_compile_lit_multi(patterns.data(), flags.data(),
ids.data(), lens.data(), count,
full_mode, nullptr, &db, &compile_err);
timer.complete();
} else {
timer.start();
err = hs_compile_ext_multi(patterns.data(), flags.data(),
ids.data(), ext_ptr.data(), count,
full_mode, nullptr, &db, &compile_err);
timer.complete();
}
#endif
compileSecs = timer.seconds();
peakMemorySize = getPeakHeap();

View File

@ -336,9 +336,8 @@ void checkExpression(UNUSED void *threadarg) {
#else
if (use_literal_api) {
size_t len = strlen(regexp);
err = hs_compile_lit_multi_int(&regexp, &flags, nullptr, &extp,
&len, 1, mode, nullptr, &db,
&compile_err, *g_grey);
err = hs_compile_lit_multi(&regexp, &flags, nullptr, &len, 1,
mode, nullptr, &db, &compile_err);
} else {
err = hs_compile_ext_multi(&regexp, &flags, nullptr, &extp, 1,
mode, nullptr, &db, &compile_err);