aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-08-15 16:58:37 +0300
committershadchin <shadchin@yandex-team.com>2023-08-15 18:14:44 +0300
commit47b2ba312324ddf016c210b2a7072b9cbb0719ee (patch)
tree23fa416328a842f28afc39d63cafe1b29d6186cb
parent183828b85d8da109522e46c6c7720664d8552e4e (diff)
downloadydb-47b2ba312324ddf016c210b2a7072b9cbb0719ee.tar.gz
Update contrib/libs/hyperscan to 5.4.2
-rw-r--r--contrib/libs/hyperscan/CHANGELOG.md25
-rw-r--r--contrib/libs/hyperscan/config-linux.h2
-rw-r--r--contrib/libs/hyperscan/hs_version.h4
-rw-r--r--contrib/libs/hyperscan/src/compiler/compiler.cpp9
-rw-r--r--contrib/libs/hyperscan/src/hs.cpp8
-rw-r--r--contrib/libs/hyperscan/src/hs.h2
-rw-r--r--contrib/libs/hyperscan/src/hs_compile.h12
-rw-r--r--contrib/libs/hyperscan/src/hs_internal.h6
-rw-r--r--contrib/libs/hyperscan/src/hwlm/noodle_engine_sse.c2
-rw-r--r--contrib/libs/hyperscan/src/nfa/goughcompile.cpp8
-rw-r--r--contrib/libs/hyperscan/src/nfa/mcclellancompile.cpp6
-rw-r--r--contrib/libs/hyperscan/src/nfa/repeatcompile.cpp4
-rw-r--r--contrib/libs/hyperscan/src/nfagraph/ng_som.cpp9
-rw-r--r--contrib/libs/hyperscan/src/nfagraph/ng_violet.cpp17
-rw-r--r--contrib/libs/hyperscan/src/parser/logical_combination.cpp3
-rw-r--r--contrib/libs/hyperscan/src/parser/utf8_validate.cpp4
-rw-r--r--contrib/libs/hyperscan/src/rose/program_runtime.c23
-rw-r--r--contrib/libs/hyperscan/src/rose/rose_build_convert.cpp4
-rw-r--r--contrib/libs/hyperscan/src/runtime.c3
-rw-r--r--contrib/libs/hyperscan/src/scratch.c2
-rw-r--r--contrib/libs/hyperscan/src/scratch.h2
-rw-r--r--contrib/libs/hyperscan/src/smallwrite/smallwrite_build.cpp2
-rw-r--r--contrib/libs/hyperscan/src/state.h2
-rw-r--r--contrib/libs/hyperscan/src/stream_compress_impl.h2
-rw-r--r--contrib/libs/hyperscan/src/util/alloc.h6
-rw-r--r--contrib/libs/hyperscan/src/util/graph_undirected.h4
-rw-r--r--contrib/libs/hyperscan/src/util/simd_utils.h26
-rw-r--r--contrib/libs/hyperscan/src/util/ue2string.h2
-rw-r--r--contrib/libs/hyperscan/ya.make6
29 files changed, 154 insertions, 51 deletions
diff --git a/contrib/libs/hyperscan/CHANGELOG.md b/contrib/libs/hyperscan/CHANGELOG.md
index 8de3a8d6c9..09b4a95cf5 100644
--- a/contrib/libs/hyperscan/CHANGELOG.md
+++ b/contrib/libs/hyperscan/CHANGELOG.md
@@ -2,6 +2,31 @@
This is a list of notable changes to Hyperscan, in reverse chronological order.
+## [5.4.2] 2023-04-19
+- Roll back bugfix for github issue #350: Besides using scratch for
+ corresponding database, Hyperscan also allows user to use larger scratch
+ allocated for another database. Users can leverage this property to achieve
+ safe scratch usage in multi-database scenarios. Behaviors beyond these are
+ discouraged and results are undefined.
+- Fix hsdump issue due to invalid nfa type.
+
+## [5.4.1] 2023-02-20
+- The Intel Hyperscan team is pleased to provide a bug fix release to our open source library.
+ Intel also maintains an upgraded version available through your Intel sales representative.
+- Bugfix for issue #184: fix random char value of UTF-8.
+- Bugfix for issue #291: bypass logical combination flag in hs_expression_info().
+- Bugfix for issue #292: fix build error due to libc symbol parsing.
+- Bugfix for issue #302/304: add empty string check for pure literal API.
+- Bugfix for issue #303: fix unknown instruction error in pure literal API.
+- Bugfix for issue #303: avoid memory leak in stream close stage.
+- Bugfix for issue #305: fix assertion failure in DFA construction.
+- Bugfix for issue #317: fix aligned allocator segment faults.
+- Bugfix for issue #350: add quick validity check for scratch.
+- Bugfix for issue #359: fix glibc-2.34 stack size issue.
+- Bugfix for issue #360: fix SKIP flag issue in chimera.
+- Bugfix for issue #362: fix one cotec check corner issue in UTF-8 validation.
+- Fix other compile issues.
+
## [5.4.0] 2020-12-31
- Improvement on literal matcher "Fat Teddy" performance, including
support for Intel(R) AVX-512 Vector Byte Manipulation Instructions (Intel(R)
diff --git a/contrib/libs/hyperscan/config-linux.h b/contrib/libs/hyperscan/config-linux.h
index 56951c3881..0362f388f7 100644
--- a/contrib/libs/hyperscan/config-linux.h
+++ b/contrib/libs/hyperscan/config-linux.h
@@ -96,7 +96,7 @@
#define HS_VERSION
#define HS_MAJOR_VERSION
#define HS_MINOR_VERSION
-/* #undef HS_PATCH_VERSION */
+#define HS_PATCH_VERSION
#define BUILD_DATE
diff --git a/contrib/libs/hyperscan/hs_version.h b/contrib/libs/hyperscan/hs_version.h
index af41f33bbc..38fa2a90d3 100644
--- a/contrib/libs/hyperscan/hs_version.h
+++ b/contrib/libs/hyperscan/hs_version.h
@@ -32,9 +32,9 @@
/**
* A version string to identify this release of Hyperscan.
*/
-#define HS_VERSION_STRING "5.4.0 1980-01-01"
+#define HS_VERSION_STRING "5.4.2 1980-01-01"
-#define HS_VERSION_32BIT ((5 << 24) | (4 << 16) | (0 << 8) | 0)
+#define HS_VERSION_32BIT ((5 << 24) | (4 << 16) | (2 << 8) | 0)
#endif /* HS_VERSION_H_C6428FAF8E3713 */
diff --git a/contrib/libs/hyperscan/src/compiler/compiler.cpp b/contrib/libs/hyperscan/src/compiler/compiler.cpp
index 5751bd64f4..35f46b3fea 100644
--- a/contrib/libs/hyperscan/src/compiler/compiler.cpp
+++ b/contrib/libs/hyperscan/src/compiler/compiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, Intel Corporation
+ * Copyright (c) 2015-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -323,7 +323,8 @@ void addExpression(NG &ng, unsigned index, const char *expression,
}
// Ensure that our pattern isn't too long (in characters).
- if (strlen(expression) > cc.grey.limitPatternLength) {
+ size_t maxlen = cc.grey.limitPatternLength + 1;
+ if (strnlen(expression, maxlen) >= maxlen) {
throw CompileError("Pattern length exceeds limit.");
}
@@ -416,6 +417,10 @@ void addLitExpression(NG &ng, unsigned index, const char *expression,
"HS_FLAG_SOM_LEFTMOST are supported in literal API.");
}
+ if (!strcmp(expression, "")) {
+ throw CompileError("Pure literal API doesn't support empty string.");
+ }
+
// This expression must be a pure literal, we can build ue2_literal
// directly based on expression text.
ParsedLitExpression ple(index, expression, expLength, flags, id);
diff --git a/contrib/libs/hyperscan/src/hs.cpp b/contrib/libs/hyperscan/src/hs.cpp
index eac588891c..ae9cdf1468 100644
--- a/contrib/libs/hyperscan/src/hs.cpp
+++ b/contrib/libs/hyperscan/src/hs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, Intel Corporation
+ * Copyright (c) 2015-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -514,6 +514,12 @@ hs_error_t hs_expression_info_int(const char *expression, unsigned int flags,
return HS_COMPILER_ERROR;
}
+ if (flags & HS_FLAG_COMBINATION) {
+ *error = generateCompileError("Invalid parameter: unsupported "
+ "logical combination expression", -1);
+ return HS_COMPILER_ERROR;
+ }
+
*info = nullptr;
*error = nullptr;
diff --git a/contrib/libs/hyperscan/src/hs.h b/contrib/libs/hyperscan/src/hs.h
index 2fe5d248b7..3d3c5cdeac 100644
--- a/contrib/libs/hyperscan/src/hs.h
+++ b/contrib/libs/hyperscan/src/hs.h
@@ -43,7 +43,7 @@
#define HS_MAJOR 5
#define HS_MINOR 4
-#define HS_PATCH 0
+#define HS_PATCH 2
#include "hs_compile.h"
#include "hs_runtime.h"
diff --git a/contrib/libs/hyperscan/src/hs_compile.h b/contrib/libs/hyperscan/src/hs_compile.h
index b318c29db1..5aa2418868 100644
--- a/contrib/libs/hyperscan/src/hs_compile.h
+++ b/contrib/libs/hyperscan/src/hs_compile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, Intel Corporation
+ * Copyright (c) 2015-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -748,10 +748,7 @@ hs_error_t HS_CDECL hs_free_compile_error(hs_compile_error_t *error);
* - HS_FLAG_PREFILTER - Compile pattern in prefiltering mode.
* - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset
* when a match is found.
- * - HS_FLAG_COMBINATION - Parse the expression in logical combination
- * syntax.
- * - HS_FLAG_QUIET - Ignore match reporting for this expression. Used for
- * the sub-expressions in logical combinations.
+ * - HS_FLAG_QUIET - This flag will be ignored.
*
* @param info
* On success, a pointer to the pattern information will be returned in
@@ -814,10 +811,7 @@ hs_error_t HS_CDECL hs_expression_info(const char *expression,
* - HS_FLAG_PREFILTER - Compile pattern in prefiltering mode.
* - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset
* when a match is found.
- * - HS_FLAG_COMBINATION - Parse the expression in logical combination
- * syntax.
- * - HS_FLAG_QUIET - Ignore match reporting for this expression. Used for
- * the sub-expressions in logical combinations.
+ * - HS_FLAG_QUIET - This flag will be ignored.
*
* @param ext
* A pointer to a filled @ref hs_expr_ext_t structure that defines
diff --git a/contrib/libs/hyperscan/src/hs_internal.h b/contrib/libs/hyperscan/src/hs_internal.h
index adf07b22cf..4eb5e157cb 100644
--- a/contrib/libs/hyperscan/src/hs_internal.h
+++ b/contrib/libs/hyperscan/src/hs_internal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Intel Corporation
+ * Copyright (c) 2019-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -80,7 +80,9 @@ extern "C"
| HS_FLAG_PREFILTER \
| HS_FLAG_SINGLEMATCH \
| HS_FLAG_ALLOWEMPTY \
- | HS_FLAG_SOM_LEFTMOST)
+ | HS_FLAG_SOM_LEFTMOST \
+ | HS_FLAG_COMBINATION \
+ | HS_FLAG_QUIET)
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/hyperscan/src/hwlm/noodle_engine_sse.c b/contrib/libs/hyperscan/src/hwlm/noodle_engine_sse.c
index 7cd53d7ced..58ace3b6de 100644
--- a/contrib/libs/hyperscan/src/hwlm/noodle_engine_sse.c
+++ b/contrib/libs/hyperscan/src/hwlm/noodle_engine_sse.c
@@ -106,7 +106,7 @@ hwlm_error_t scanDoubleShort(const struct noodTable *n, const u8 *buf,
if (!l) {
return HWLM_SUCCESS;
}
- assert(l <= 32);
+ assert(l <= 16);
DEBUG_PRINTF("d %zu\n", d - buf);
m128 v = zeroes128();
diff --git a/contrib/libs/hyperscan/src/nfa/goughcompile.cpp b/contrib/libs/hyperscan/src/nfa/goughcompile.cpp
index d41c6f4235..47594f2ece 100644
--- a/contrib/libs/hyperscan/src/nfa/goughcompile.cpp
+++ b/contrib/libs/hyperscan/src/nfa/goughcompile.cpp
@@ -207,6 +207,10 @@ void makeCFG_top_edge(GoughGraph &cfg, const vector<GoughVertex> &vertices,
assert(contains(src_slots, slot_id));
shared_ptr<GoughSSAVarMin> vmin = make_shared<GoughSSAVarMin>();
+ if (!vmin) {
+ assert(0);
+ throw std::bad_alloc();
+ }
cfg[e].vars.push_back(vmin);
final_var = vmin.get();
@@ -318,6 +322,10 @@ void makeCFG_edge(GoughGraph &cfg, const map<u32, u32> &som_creators,
DEBUG_PRINTF("bypassing min on join %u\n", slot_id);
} else {
shared_ptr<GoughSSAVarMin> vmin = make_shared<GoughSSAVarMin>();
+ if (!vmin) {
+ assert(0);
+ throw std::bad_alloc();
+ }
cfg[e].vars.push_back(vmin);
final_var = vmin.get();
diff --git a/contrib/libs/hyperscan/src/nfa/mcclellancompile.cpp b/contrib/libs/hyperscan/src/nfa/mcclellancompile.cpp
index 27ec1716e9..6ae9558cec 100644
--- a/contrib/libs/hyperscan/src/nfa/mcclellancompile.cpp
+++ b/contrib/libs/hyperscan/src/nfa/mcclellancompile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, Intel Corporation
+ * Copyright (c) 2015-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -1082,7 +1082,9 @@ void find_better_daddy(dfa_info &info, dstate_id_t curr_id, bool using8bit,
// Use the daddy already set for this state so long as it isn't already
// a Sherman state.
dstate_id_t daddy = currState.daddy;
- if (!info.is_sherman(daddy) && !info.is_widestate(daddy)) {
+ if (info.is_widestate(daddy)) {
+ return;
+ } else if (!info.is_sherman(daddy)) {
hinted.insert(currState.daddy);
} else {
// Fall back to granddaddy, which has already been processed (due
diff --git a/contrib/libs/hyperscan/src/nfa/repeatcompile.cpp b/contrib/libs/hyperscan/src/nfa/repeatcompile.cpp
index 934dd29e6b..d15ae89b56 100644
--- a/contrib/libs/hyperscan/src/nfa/repeatcompile.cpp
+++ b/contrib/libs/hyperscan/src/nfa/repeatcompile.cpp
@@ -124,6 +124,10 @@ RepeatStateInfo::RepeatStateInfo(enum RepeatType type, const depth &repeatMin,
const depth &repeatMax, u32 minPeriod)
: stateSize(0), packedCtrlSize(0), horizon(0), patchCount(0),
patchSize(0), encodingSize(0), patchesOffset(0) {
+ if (type == REPEAT_SPARSE_OPTIMAL_P && minPeriod == 0) {
+ assert(0);
+ throw std::domain_error("SPARSE_OPTIMAL_P must have non-zero minPeriod.");
+ }
assert(repeatMin <= repeatMax);
assert(repeatMax.is_reachable());
assert(minPeriod || type != REPEAT_SPARSE_OPTIMAL_P);
diff --git a/contrib/libs/hyperscan/src/nfagraph/ng_som.cpp b/contrib/libs/hyperscan/src/nfagraph/ng_som.cpp
index d23ac408b0..47cc82dae8 100644
--- a/contrib/libs/hyperscan/src/nfagraph/ng_som.cpp
+++ b/contrib/libs/hyperscan/src/nfagraph/ng_som.cpp
@@ -2446,6 +2446,10 @@ static
bool doLitHaigSom(NG &ng, NGHolder &g, som_type som) {
ue2_literal lit;
shared_ptr<NGHolder> rhs = make_shared<NGHolder>();
+ if (!rhs) {
+ assert(0);
+ throw std::bad_alloc();
+ }
if (!ng.cc.grey.allowLitHaig) {
return false;
}
@@ -2510,6 +2514,11 @@ bool doHaigLitHaigSom(NG &ng, NGHolder &g,
ue2_literal lit;
shared_ptr<NGHolder> rhs = make_shared<NGHolder>();
shared_ptr<NGHolder> lhs = make_shared<NGHolder>();
+ if (!rhs || !lhs) {
+ assert(0);
+ throw std::bad_alloc();
+ }
+
if (!splitOffBestLiteral(g, regions, &lit, &*lhs, &*rhs, ng.cc)) {
return false;
}
diff --git a/contrib/libs/hyperscan/src/nfagraph/ng_violet.cpp b/contrib/libs/hyperscan/src/nfagraph/ng_violet.cpp
index 685d452150..700208dc38 100644
--- a/contrib/libs/hyperscan/src/nfagraph/ng_violet.cpp
+++ b/contrib/libs/hyperscan/src/nfagraph/ng_violet.cpp
@@ -1036,6 +1036,11 @@ bool splitRoseEdge(const NGHolder &base_graph, RoseInGraph &vg,
shared_ptr<NGHolder> lhs = make_shared<NGHolder>();
shared_ptr<NGHolder> rhs = make_shared<NGHolder>();
+ if (!lhs || !rhs) {
+ assert(0);
+ throw std::bad_alloc();
+ }
+
unordered_map<NFAVertex, NFAVertex> lhs_map;
unordered_map<NFAVertex, NFAVertex> rhs_map;
@@ -1229,6 +1234,10 @@ void splitEdgesByCut(NGHolder &h, RoseInGraph &vg,
DEBUG_PRINTF("splitting on pivot %zu\n", h[pivot].index);
unordered_map<NFAVertex, NFAVertex> temp_map;
shared_ptr<NGHolder> new_lhs = make_shared<NGHolder>();
+ if (!new_lhs) {
+ assert(0);
+ throw std::bad_alloc();
+ }
splitLHS(h, pivot, new_lhs.get(), &temp_map);
/* want to cut off paths to pivot from things other than the pivot -
@@ -1310,6 +1319,10 @@ void splitEdgesByCut(NGHolder &h, RoseInGraph &vg,
if (!contains(done_rhs, adj)) {
unordered_map<NFAVertex, NFAVertex> temp_map;
shared_ptr<NGHolder> new_rhs = make_shared<NGHolder>();
+ if (!new_rhs) {
+ assert(0);
+ throw std::bad_alloc();
+ }
splitRHS(h, adj, new_rhs.get(), &temp_map);
remove_edge(new_rhs->start, new_rhs->accept, *new_rhs);
remove_edge(new_rhs->start, new_rhs->acceptEod, *new_rhs);
@@ -2281,6 +2294,10 @@ void splitEdgesForSuffix(const NGHolder &base_graph, RoseInGraph &vg,
assert(!splitters.empty());
shared_ptr<NGHolder> lhs = make_shared<NGHolder>();
+ if (!lhs) {
+ assert(0);
+ throw bad_alloc();
+ }
unordered_map<NFAVertex, NFAVertex> v_map;
cloneHolder(*lhs, base_graph, &v_map);
lhs->kind = NFA_INFIX;
diff --git a/contrib/libs/hyperscan/src/parser/logical_combination.cpp b/contrib/libs/hyperscan/src/parser/logical_combination.cpp
index de017a1108..96c3bd89de 100644
--- a/contrib/libs/hyperscan/src/parser/logical_combination.cpp
+++ b/contrib/libs/hyperscan/src/parser/logical_combination.cpp
@@ -140,7 +140,8 @@ void ParsedLogical::validateSubIDs(const unsigned *ids,
}
hs_compile_error_t *compile_err = NULL;
hs_expr_info_t *info = NULL;
- hs_error_t err = hs_expression_info(expressions[i], flags[i], &info,
+ hs_error_t err = hs_expression_info(expressions[i],
+ flags ? flags[i] : 0, &info,
&compile_err);
if (err != HS_SUCCESS) {
hs_free_compile_error(compile_err);
diff --git a/contrib/libs/hyperscan/src/parser/utf8_validate.cpp b/contrib/libs/hyperscan/src/parser/utf8_validate.cpp
index 50aa06d8e7..54c9755e8a 100644
--- a/contrib/libs/hyperscan/src/parser/utf8_validate.cpp
+++ b/contrib/libs/hyperscan/src/parser/utf8_validate.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2022, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -72,7 +72,7 @@ bool isValidUtf8(const char *expression, const size_t len) {
while (i < len) {
DEBUG_PRINTF("byte %zu: 0x%02x\n", i, s[i]);
// One octet.
- if (s[i] < 0x7f) {
+ if (s[i] <= 0x7f) {
DEBUG_PRINTF("one octet\n");
i++;
continue;
diff --git a/contrib/libs/hyperscan/src/rose/program_runtime.c b/contrib/libs/hyperscan/src/rose/program_runtime.c
index ff5a5099c9..579ce27835 100644
--- a/contrib/libs/hyperscan/src/rose/program_runtime.c
+++ b/contrib/libs/hyperscan/src/rose/program_runtime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, Intel Corporation
+ * Copyright (c) 2015-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -3110,6 +3110,7 @@ hwlmcb_rv_t roseRunProgram_l(const struct RoseEngine *t,
const char in_catchup = prog_flags & ROSE_PROG_FLAG_IN_CATCHUP;
const char from_mpv = prog_flags & ROSE_PROG_FLAG_FROM_MPV;
+ const char skip_mpv_catchup = prog_flags & ROSE_PROG_FLAG_SKIP_MPV_CATCHUP;
const char *pc_base = getByOffset(t, programOffset);
const char *pc = pc_base;
@@ -3206,6 +3207,17 @@ hwlmcb_rv_t roseRunProgram_l(const struct RoseEngine *t,
}
L_PROGRAM_NEXT_INSTRUCTION
+ L_PROGRAM_CASE(CATCH_UP_MPV) {
+ if (from_mpv || skip_mpv_catchup) {
+ DEBUG_PRINTF("skipping mpv catchup\n");
+ } else if (roseCatchUpMPV(t,
+ end - scratch->core_info.buf_offset,
+ scratch) == HWLM_TERMINATE_MATCHING) {
+ return HWLM_TERMINATE_MATCHING;
+ }
+ }
+ L_PROGRAM_NEXT_INSTRUCTION
+
L_PROGRAM_CASE(SOM_FROM_REPORT) {
som = handleSomExternal(scratch, &ri->som, end);
DEBUG_PRINTF("som from report %u is %llu\n", ri->som.onmatch,
@@ -3213,6 +3225,15 @@ hwlmcb_rv_t roseRunProgram_l(const struct RoseEngine *t,
}
L_PROGRAM_NEXT_INSTRUCTION
+ L_PROGRAM_CASE(TRIGGER_SUFFIX) {
+ if (roseTriggerSuffix(t, scratch, ri->queue, ri->event, som,
+ end) == HWLM_TERMINATE_MATCHING) {
+ return HWLM_TERMINATE_MATCHING;
+ }
+ work_done = 1;
+ }
+ L_PROGRAM_NEXT_INSTRUCTION
+
L_PROGRAM_CASE(DEDUPE) {
updateSeqPoint(tctxt, end, from_mpv);
const char do_som = t->hasSom; // TODO: constant propagate
diff --git a/contrib/libs/hyperscan/src/rose/rose_build_convert.cpp b/contrib/libs/hyperscan/src/rose/rose_build_convert.cpp
index 33351099f7..d5b73cad55 100644
--- a/contrib/libs/hyperscan/src/rose/rose_build_convert.cpp
+++ b/contrib/libs/hyperscan/src/rose/rose_build_convert.cpp
@@ -562,6 +562,10 @@ bool handleMixedPrefixCliche(const NGHolder &h, RoseGraph &g, RoseVertex v,
DEBUG_PRINTF("woot?\n");
shared_ptr<NGHolder> h_new = make_shared<NGHolder>();
+ if (!h_new) {
+ assert(0);
+ throw std::bad_alloc();
+ }
unordered_map<NFAVertex, NFAVertex> rhs_map;
vector<NFAVertex> exits_vec;
insert(&exits_vec, exits_vec.end(), exits);
diff --git a/contrib/libs/hyperscan/src/runtime.c b/contrib/libs/hyperscan/src/runtime.c
index a3659348c5..a055e5f4f5 100644
--- a/contrib/libs/hyperscan/src/runtime.c
+++ b/contrib/libs/hyperscan/src/runtime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2019, Intel Corporation
+ * Copyright (c) 2015-2022, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -1013,6 +1013,7 @@ hs_error_t HS_CDECL hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch,
report_eod_matches(id, scratch, onEvent, context);
if (unlikely(internal_matching_error(scratch))) {
unmarkScratchInUse(scratch);
+ hs_stream_free(id);
return HS_UNKNOWN_ERROR;
}
unmarkScratchInUse(scratch);
diff --git a/contrib/libs/hyperscan/src/scratch.c b/contrib/libs/hyperscan/src/scratch.c
index 25991e2bba..9f6d77cdc4 100644
--- a/contrib/libs/hyperscan/src/scratch.c
+++ b/contrib/libs/hyperscan/src/scratch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2019, Intel Corporation
+ * Copyright (c) 2015-2023, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/contrib/libs/hyperscan/src/scratch.h b/contrib/libs/hyperscan/src/scratch.h
index 1256f7aba8..e3cd924521 100644
--- a/contrib/libs/hyperscan/src/scratch.h
+++ b/contrib/libs/hyperscan/src/scratch.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2019, Intel Corporation
+ * Copyright (c) 2015-2023, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/contrib/libs/hyperscan/src/smallwrite/smallwrite_build.cpp b/contrib/libs/hyperscan/src/smallwrite/smallwrite_build.cpp
index d993137632..d2c79ceeb8 100644
--- a/contrib/libs/hyperscan/src/smallwrite/smallwrite_build.cpp
+++ b/contrib/libs/hyperscan/src/smallwrite/smallwrite_build.cpp
@@ -78,7 +78,7 @@ namespace ue2 {
struct LitTrieVertexProps {
LitTrieVertexProps() = default;
explicit LitTrieVertexProps(u8 c_in) : c(c_in) {}
- size_t index; // managed by ue2_graph
+ size_t index = 0; // managed by ue2_graph
u8 c = 0; //!< character reached on this vertex
flat_set<ReportID> reports; //!< managed reports fired on this vertex
};
diff --git a/contrib/libs/hyperscan/src/state.h b/contrib/libs/hyperscan/src/state.h
index 9ade59db4b..68600a910f 100644
--- a/contrib/libs/hyperscan/src/state.h
+++ b/contrib/libs/hyperscan/src/state.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2023, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/contrib/libs/hyperscan/src/stream_compress_impl.h b/contrib/libs/hyperscan/src/stream_compress_impl.h
index d1ccf5e6d0..f02543efa5 100644
--- a/contrib/libs/hyperscan/src/stream_compress_impl.h
+++ b/contrib/libs/hyperscan/src/stream_compress_impl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018, Intel Corporation
+ * Copyright (c) 2017-2023, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/contrib/libs/hyperscan/src/util/alloc.h b/contrib/libs/hyperscan/src/util/alloc.h
index de20c8d028..49b4a824d1 100644
--- a/contrib/libs/hyperscan/src/util/alloc.h
+++ b/contrib/libs/hyperscan/src/util/alloc.h
@@ -76,7 +76,11 @@ public:
T *allocate(std::size_t size) const {
size_t alloc_size = size * sizeof(T);
- return static_cast<T *>(aligned_malloc_internal(alloc_size, N));
+ T *ptr = static_cast<T *>(aligned_malloc_internal(alloc_size, N));
+ if (!ptr) {
+ throw std::bad_alloc();
+ }
+ return ptr;
}
void deallocate(T *x, std::size_t) const noexcept {
diff --git a/contrib/libs/hyperscan/src/util/graph_undirected.h b/contrib/libs/hyperscan/src/util/graph_undirected.h
index 049964ab07..5071728473 100644
--- a/contrib/libs/hyperscan/src/util/graph_undirected.h
+++ b/contrib/libs/hyperscan/src/util/graph_undirected.h
@@ -70,8 +70,8 @@ class undirected_graph_edge_descriptor
using base_vertex_type = typename base_graph_traits::vertex_descriptor;
base_edge_type underlying_edge;
- const base_graph_type *g;
- bool reverse; // if true, reverse vertices in source() and target()
+ const base_graph_type *g = nullptr;
+ bool reverse = false; // if true, reverse vertices in source() and target()
inline std::pair<base_vertex_type, base_vertex_type>
canonical_edge() const {
diff --git a/contrib/libs/hyperscan/src/util/simd_utils.h b/contrib/libs/hyperscan/src/util/simd_utils.h
index d1f060b070..5fa727e5dd 100644
--- a/contrib/libs/hyperscan/src/util/simd_utils.h
+++ b/contrib/libs/hyperscan/src/util/simd_utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2020, Intel Corporation
+ * Copyright (c) 2015-2021, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -156,6 +156,16 @@ static really_inline u32 movd(const m128 in) {
return _mm_cvtsi128_si32(in);
}
+static really_inline u64a movq(const m128 in) {
+#if defined(ARCH_X86_64)
+ return _mm_cvtsi128_si64(in);
+#else // 32-bit - this is horrific
+ u32 lo = movd(in);
+ u32 hi = movd(_mm_srli_epi64(in, 32));
+ return (u64a)hi << 32 | lo;
+#endif
+}
+
#if defined(HAVE_AVX512)
static really_inline u32 movd512(const m512 in) {
// NOTE: seems gcc doesn't support _mm512_cvtsi512_si32(in),
@@ -166,20 +176,10 @@ static really_inline u32 movd512(const m512 in) {
static really_inline u64a movq512(const m512 in) {
// NOTE: seems AVX512 doesn't support _mm512_cvtsi512_si64(in),
// so we use 2-step convertions to work around.
- return _mm_cvtsi128_si64(_mm512_castsi512_si128(in));
+ return movq(_mm512_castsi512_si128(in));
}
#endif
-static really_inline u64a movq(const m128 in) {
-#if defined(ARCH_X86_64)
- return _mm_cvtsi128_si64(in);
-#else // 32-bit - this is horrific
- u32 lo = movd(in);
- u32 hi = movd(_mm_srli_epi64(in, 32));
- return (u64a)hi << 32 | lo;
-#endif
-}
-
/* another form of movq */
static really_inline
m128 load_m128_from_u64a(const u64a *p) {
@@ -791,7 +791,7 @@ m128 movdq_lo(m256 x) {
#define lshift128_m256(a, count_immed) _mm256_slli_si256(a, count_immed)
#define extract64from256(a, imm) _mm_extract_epi64(_mm256_extracti128_si256(a, imm >> 1), imm % 2)
#define extract32from256(a, imm) _mm_extract_epi32(_mm256_extracti128_si256(a, imm >> 2), imm % 4)
-#define extractlow64from256(a) _mm_cvtsi128_si64(cast256to128(a))
+#define extractlow64from256(a) movq(cast256to128(a))
#define extractlow32from256(a) movd(cast256to128(a))
#define interleave256hi(a, b) _mm256_unpackhi_epi8(a, b)
#define interleave256lo(a, b) _mm256_unpacklo_epi8(a, b)
diff --git a/contrib/libs/hyperscan/src/util/ue2string.h b/contrib/libs/hyperscan/src/util/ue2string.h
index 0aa846896e..f436936d71 100644
--- a/contrib/libs/hyperscan/src/util/ue2string.h
+++ b/contrib/libs/hyperscan/src/util/ue2string.h
@@ -133,7 +133,7 @@ public:
: lit(&lit_in), idx(idx_in) {}
const ue2_literal *lit = nullptr;
- size_t idx;
+ size_t idx = 0;
};
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
diff --git a/contrib/libs/hyperscan/ya.make b/contrib/libs/hyperscan/ya.make
index 7b54bfbd3a..a5f2875690 100644
--- a/contrib/libs/hyperscan/ya.make
+++ b/contrib/libs/hyperscan/ya.make
@@ -1,4 +1,4 @@
-# Generated by devtools/yamaker from nixpkgs 22.05.
+# Generated by devtools/yamaker from nixpkgs 22.11.
LIBRARY()
@@ -10,9 +10,9 @@ LICENSE(
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(5.4.0)
+VERSION(5.4.2)
-ORIGINAL_SOURCE(https://github.com/intel/hyperscan/archive/v5.4.0.tar.gz)
+ORIGINAL_SOURCE(https://github.com/intel/hyperscan/archive/v5.4.2.tar.gz)
PEERDIR(
contrib/restricted/boost/dynamic_bitset