Skip to content

Commit d79973e

Browse files
committed
Merge branch 'github_develop' into github_master
2 parents 4cebdaa + a15927a commit d79973e

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This is a list of notable changes to Hyperscan, in reverse chronological order.
44

5+
## [5.2.1] 2019-10-13
6+
- Bugfix for issue #186: fix compile issue when `BUILD_SHARED_LIBS` is on in
7+
release mode.
8+
- Disable redundant move check for older compiler versions.
9+
510
## [5.2.0] 2019-07-12
611
- Literal API: add new API `hs_compile_lit()` and `hs_compile_lit_multi()` to
712
process pure literal rule sets. The 2 literal APIs treat each expression text

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project (hyperscan C CXX)
33

44
set (HS_MAJOR_VERSION 5)
55
set (HS_MINOR_VERSION 2)
6-
set (HS_PATCH_VERSION 0)
6+
set (HS_PATCH_VERSION 1)
77
set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION})
88

99
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
@@ -395,6 +395,12 @@ if (CXX_IGNORED_ATTR)
395395
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-ignored-attributes")
396396
endif()
397397

398+
# gcc 9 complains about redundant move for returned variable
399+
CHECK_CXX_COMPILER_FLAG("-Wredundant-move" CXX_REDUNDANT_MOVE)
400+
if (CXX_REDUNDANT_MOVE)
401+
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-redundant-move")
402+
endif()
403+
398404
# note this for later
399405
# g++ doesn't have this flag but clang does
400406
CHECK_CXX_COMPILER_FLAG("-Wweak-vtables" CXX_WEAK_VTABLES)

doc/dev-reference/compilation.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,9 @@ When an expression has the :c:member:`HS_FLAG_COMBINATION` flag set, it ignores
613613
all other flags except the :c:member:`HS_FLAG_SINGLEMATCH` flag and the
614614
:c:member:`HS_FLAG_QUIET` flag.
615615
616-
Hyperscan will reject logical combination expressions at compile time that
617-
evaluate to *true* when no patterns have matched; for example: ::
616+
Hyperscan will accept logical combination expressions at compile time that
617+
evaluate to *true* when no patterns have matched, and report the match for
618+
combination at end of data if no patterns have matched; for example: ::
618619
619620
!101
620621
!101|102

tools/hsbench/engine_hyperscan.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
414414
hs_compile_error_t *compile_err;
415415
Timer timer;
416416

417+
#ifndef RELEASE_BUILD
417418
if (useLiteralApi) {
418419
// Pattern length computation should be done before timer start.
419420
vector<size_t> lens(count);
@@ -434,6 +435,26 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
434435
grey);
435436
timer.complete();
436437
}
438+
#else
439+
if (useLiteralApi) {
440+
// Pattern length computation should be done before timer start.
441+
vector<size_t> lens(count);
442+
for (unsigned int i = 0; i < count; i++) {
443+
lens[i] = strlen(patterns[i]);
444+
}
445+
timer.start();
446+
err = hs_compile_lit_multi(patterns.data(), flags.data(),
447+
ids.data(), lens.data(), count,
448+
full_mode, nullptr, &db, &compile_err);
449+
timer.complete();
450+
} else {
451+
timer.start();
452+
err = hs_compile_ext_multi(patterns.data(), flags.data(),
453+
ids.data(), ext_ptr.data(), count,
454+
full_mode, nullptr, &db, &compile_err);
455+
timer.complete();
456+
}
457+
#endif
437458

438459
compileSecs = timer.seconds();
439460
peakMemorySize = getPeakHeap();

tools/hscheck/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,8 @@ void checkExpression(UNUSED void *threadarg) {
336336
#else
337337
if (use_literal_api) {
338338
size_t len = strlen(regexp);
339-
err = hs_compile_lit_multi_int(&regexp, &flags, nullptr, &extp,
340-
&len, 1, mode, nullptr, &db,
341-
&compile_err, *g_grey);
339+
err = hs_compile_lit_multi(&regexp, &flags, nullptr, &len, 1,
340+
mode, nullptr, &db, &compile_err);
342341
} else {
343342
err = hs_compile_ext_multi(&regexp, &flags, nullptr, &extp, 1,
344343
mode, nullptr, &db, &compile_err);

0 commit comments

Comments
 (0)