Skip to content

Commit

Permalink
Merge branch develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Barr committed Jul 26, 2017
2 parents 5f6096d + 44e45f7 commit 7097ff3
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## [4.5.2] 2017-07-26
- Bugfix for issue #57: Treat characters between `\Q.\E` as codepoints in
UTF8 mode.
- Bugfix for issue #60: Use a portable flag for mktemp for fat runtime builds.
- Bugfix for fat runtime builds on AVX-512 capable machines with Hyperscan's
AVX-512 support disabled.

## [4.5.1] 2017-06-16
- Bugfix for issue #56: workaround for gcc-4.8 C++11 defect.
- Bugfix for literal matching table generation, reversing a regression in
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project (hyperscan C CXX)

set (HS_MAJOR_VERSION 4)
set (HS_MINOR_VERSION 5)
set (HS_PATCH_VERSION 1)
set (HS_PATCH_VERSION 2)
set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION})

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down
4 changes: 2 additions & 2 deletions cmake/build_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ shift 2
# $@ contains the actual build command
OUT=$(echo "$@" | sed 's/.* -o \(.*\.o\).*/\1/')
trap cleanup INT QUIT EXIT
SYMSFILE=$(mktemp --tmpdir ${PREFIX}_rename.syms.XXXXX)
KEEPSYMS=$(mktemp --tmpdir keep.syms.XXXXX)
SYMSFILE=$(mktemp -p /tmp ${PREFIX}_rename.syms.XXXXX)
KEEPSYMS=$(mktemp -p /tmp keep.syms.XXXXX)
# find the libc used by gcc
LIBC_SO=$("$@" --print-file-name=libc.so.6)
cp ${KEEPSYMS_IN} ${KEEPSYMS}
Expand Down
3 changes: 3 additions & 0 deletions cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
/* Define if building "fat" runtime. */
#cmakedefine FAT_RUNTIME

/* Define if building AVX-512 in the fat runtime. */
#cmakedefine BUILD_AVX512

/* Define to 1 if `backtrace' works. */
#cmakedefine HAVE_BACKTRACE

Expand Down
59 changes: 59 additions & 0 deletions src/parser/Parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,40 @@ unichar readUtf8CodePoint4c(const char *s) {
'\\E' => {
fgoto main;
};

#unicode chars
utf8_2c when is_utf8 => {
assert(mode.utf8);
/* leverage ComponentClass to generate the vertices */
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint2c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
};

utf8_3c when is_utf8 => {
assert(mode.utf8);
/* leverage ComponentClass to generate the vertices */
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint3c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
};

utf8_4c when is_utf8 => {
assert(mode.utf8);
/* leverage ComponentClass to generate the vertices */
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint4c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
};

hi_byte when is_utf8 => {
assert(mode.utf8);
throwInvalidUtf8();
};

# Literal character
any => {
addLiteral(currentSeq, *ts, mode);
Expand All @@ -1169,6 +1203,31 @@ unichar readUtf8CodePoint4c(const char *s) {
'\\E' => {
fret;
};

#unicode chars
utf8_2c when is_utf8 => {
assert(mode.utf8);
currentCls->add(readUtf8CodePoint2c(ts));
inCharClassEarly = false;
};

utf8_3c when is_utf8 => {
assert(mode.utf8);
currentCls->add(readUtf8CodePoint3c(ts));
inCharClassEarly = false;
};

utf8_4c when is_utf8 => {
assert(mode.utf8);
currentCls->add(readUtf8CodePoint4c(ts));
inCharClassEarly = false;
};

hi_byte when is_utf8 => {
assert(mode.utf8);
throwInvalidUtf8();
};

# Literal character
any => {
currentCls->add(*ts);
Expand Down
3 changes: 2 additions & 1 deletion src/util/cpuid_flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ u64a cpuid_flags(void) {
cap &= ~HS_CPU_FEATURES_AVX2;
#endif

#if !defined(FAT_RUNTIME) && !defined(HAVE_AVX512)
#if (!defined(FAT_RUNTIME) && !defined(HAVE_AVX512)) || \
(defined(FAT_RUNTIME) && !defined(BUILD_AVX512))
cap &= ~HS_CPU_FEATURES_AVX512;
#endif

Expand Down
2 changes: 2 additions & 0 deletions unit/hyperscan/bad_patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,5 @@
145:/abc/8{edit_distance=1} #UTF-8 is disallowed for approximate matching.
146:/(*UTF8)abc/{edit_distance=1} #UTF-8 is disallowed for approximate matching.
147:/\b\BMYBt/s{edit_distance=1} #Pattern can never match.
148:/\Q�\Eaaaa/8 #Expression is not valid UTF-8.
149:/[\Q�\Eaaaa]/8 #Expression is not valid UTF-8.

0 comments on commit 7097ff3

Please sign in to comment.