diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-05-25 14:19:21 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-05-25 14:30:05 -0400 |
commit | 24a67ef8265e5873c0967ded296a9e57ed9f2914 (patch) | |
tree | ab48ef165aa5f83465b99354794787914f4dd9a9 /src/xregex.c | |
parent | eef75524aec3910097cb6923c30b898ad98179fe (diff) | |
download | bfs-24a67ef8265e5873c0967ded296a9e57ed9f2914.tar.xz |
sanity: Add wrappers for sanitizer interfaces
Diffstat (limited to 'src/xregex.c')
-rw-r--r-- | src/xregex.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/xregex.c b/src/xregex.c index 1143f23..ce59ff5 100644 --- a/src/xregex.c +++ b/src/xregex.c @@ -4,6 +4,7 @@ #include "xregex.h" #include "config.h" #include "diag.h" +#include "sanity.h" #include <errno.h> #include <stdlib.h> #include <string.h> @@ -175,13 +176,10 @@ int bfs_regcomp(struct bfs_regex **preg, const char *pattern, enum bfs_regex_typ cflags |= REG_ICASE; } -#if __has_feature(memory_sanitizer) - // https://github.com/google/sanitizers/issues/1496 - memset(®ex->impl, 0, sizeof(regex->impl)); -#endif - regex->err = regcomp(®ex->impl, pattern, cflags); if (regex->err != 0) { + // https://github.com/google/sanitizers/issues/1496 + sanitize_init(®ex->impl); return -1; } #endif |