From: Vsevolod Stakhov Date: Tue, 22 Nov 2016 15:17:16 +0000 (+0000) Subject: [Fix] Fix hyperscan usage for non compatible platforms X-Git-Tag: 1.4.1~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23c75a3c766039f8fc5622c984edd33cafbae929;p=thirdparty%2Frspamd.git [Fix] Fix hyperscan usage for non compatible platforms Issue: #1164 Reported by: @jirireischig --- diff --git a/src/libutil/map.c b/src/libutil/map.c index eaaea4ac05..07ce616c27 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -2278,6 +2278,12 @@ rspamd_re_map_finalize (struct rspamd_regexp_map *re_map) map = re_map->map; + if (!(map->cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) { + msg_info_map ("disable hyperscan for map %s, ssse3 instructons are not supported by CPU", + map->name); + return; + } + if (hs_populate_platform (&plt) != HS_SUCCESS) { msg_err_map ("cannot populate hyperscan platform"); return;