Skip to content

Commit 7097ff3

Browse files
author
Matthew Barr
committed
Merge branch develop into master
2 parents 5f6096d + 44e45f7 commit 7097ff3

File tree

7 files changed

+76
-4
lines changed

7 files changed

+76
-4
lines changed

CHANGELOG.md

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

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

5+
## [4.5.2] 2017-07-26
6+
- Bugfix for issue #57: Treat characters between `\Q.\E` as codepoints in
7+
UTF8 mode.
8+
- Bugfix for issue #60: Use a portable flag for mktemp for fat runtime builds.
9+
- Bugfix for fat runtime builds on AVX-512 capable machines with Hyperscan's
10+
AVX-512 support disabled.
11+
512
## [4.5.1] 2017-06-16
613
- Bugfix for issue #56: workaround for gcc-4.8 C++11 defect.
714
- Bugfix for literal matching table generation, reversing a regression in

CMakeLists.txt

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

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

99
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

cmake/build_wrapper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ shift 2
1111
# $@ contains the actual build command
1212
OUT=$(echo "$@" | sed 's/.* -o \(.*\.o\).*/\1/')
1313
trap cleanup INT QUIT EXIT
14-
SYMSFILE=$(mktemp --tmpdir ${PREFIX}_rename.syms.XXXXX)
15-
KEEPSYMS=$(mktemp --tmpdir keep.syms.XXXXX)
14+
SYMSFILE=$(mktemp -p /tmp ${PREFIX}_rename.syms.XXXXX)
15+
KEEPSYMS=$(mktemp -p /tmp keep.syms.XXXXX)
1616
# find the libc used by gcc
1717
LIBC_SO=$("$@" --print-file-name=libc.so.6)
1818
cp ${KEEPSYMS_IN} ${KEEPSYMS}

cmake/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
/* Define if building "fat" runtime. */
2222
#cmakedefine FAT_RUNTIME
2323

24+
/* Define if building AVX-512 in the fat runtime. */
25+
#cmakedefine BUILD_AVX512
26+
2427
/* Define to 1 if `backtrace' works. */
2528
#cmakedefine HAVE_BACKTRACE
2629

src/parser/Parser.rl

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,40 @@ unichar readUtf8CodePoint4c(const char *s) {
11551155
'\\E' => {
11561156
fgoto main;
11571157
};
1158+
1159+
#unicode chars
1160+
utf8_2c when is_utf8 => {
1161+
assert(mode.utf8);
1162+
/* leverage ComponentClass to generate the vertices */
1163+
auto cc = getComponentClass(mode);
1164+
cc->add(readUtf8CodePoint2c(ts));
1165+
cc->finalize();
1166+
currentSeq->addComponent(move(cc));
1167+
};
1168+
1169+
utf8_3c when is_utf8 => {
1170+
assert(mode.utf8);
1171+
/* leverage ComponentClass to generate the vertices */
1172+
auto cc = getComponentClass(mode);
1173+
cc->add(readUtf8CodePoint3c(ts));
1174+
cc->finalize();
1175+
currentSeq->addComponent(move(cc));
1176+
};
1177+
1178+
utf8_4c when is_utf8 => {
1179+
assert(mode.utf8);
1180+
/* leverage ComponentClass to generate the vertices */
1181+
auto cc = getComponentClass(mode);
1182+
cc->add(readUtf8CodePoint4c(ts));
1183+
cc->finalize();
1184+
currentSeq->addComponent(move(cc));
1185+
};
1186+
1187+
hi_byte when is_utf8 => {
1188+
assert(mode.utf8);
1189+
throwInvalidUtf8();
1190+
};
1191+
11581192
# Literal character
11591193
any => {
11601194
addLiteral(currentSeq, *ts, mode);
@@ -1169,6 +1203,31 @@ unichar readUtf8CodePoint4c(const char *s) {
11691203
'\\E' => {
11701204
fret;
11711205
};
1206+
1207+
#unicode chars
1208+
utf8_2c when is_utf8 => {
1209+
assert(mode.utf8);
1210+
currentCls->add(readUtf8CodePoint2c(ts));
1211+
inCharClassEarly = false;
1212+
};
1213+
1214+
utf8_3c when is_utf8 => {
1215+
assert(mode.utf8);
1216+
currentCls->add(readUtf8CodePoint3c(ts));
1217+
inCharClassEarly = false;
1218+
};
1219+
1220+
utf8_4c when is_utf8 => {
1221+
assert(mode.utf8);
1222+
currentCls->add(readUtf8CodePoint4c(ts));
1223+
inCharClassEarly = false;
1224+
};
1225+
1226+
hi_byte when is_utf8 => {
1227+
assert(mode.utf8);
1228+
throwInvalidUtf8();
1229+
};
1230+
11721231
# Literal character
11731232
any => {
11741233
currentCls->add(*ts);

src/util/cpuid_flags.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ u64a cpuid_flags(void) {
192192
cap &= ~HS_CPU_FEATURES_AVX2;
193193
#endif
194194

195-
#if !defined(FAT_RUNTIME) && !defined(HAVE_AVX512)
195+
#if (!defined(FAT_RUNTIME) && !defined(HAVE_AVX512)) || \
196+
(defined(FAT_RUNTIME) && !defined(BUILD_AVX512))
196197
cap &= ~HS_CPU_FEATURES_AVX512;
197198
#endif
198199

unit/hyperscan/bad_patterns.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,5 @@
142142
145:/abc/8{edit_distance=1} #UTF-8 is disallowed for approximate matching.
143143
146:/(*UTF8)abc/{edit_distance=1} #UTF-8 is disallowed for approximate matching.
144144
147:/\b\BMYBt/s{edit_distance=1} #Pattern can never match.
145+
148:/\Q�\Eaaaa/8 #Expression is not valid UTF-8.
146+
149:/[\Q�\Eaaaa]/8 #Expression is not valid UTF-8.

0 commit comments

Comments
 (0)