]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
For now I'll just disable this
authorWolfgang Bumiller <wry.git@bumiller.com>
Fri, 26 Sep 2014 13:25:33 +0000 (15:25 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Fri, 26 Sep 2014 13:25:33 +0000 (15:25 +0200)
Makefile
hash.c

index f6a21ffe301305671fd17ea32fc945fa0f5f41c9..7697cfc7c8f793daf25037348731587580e4fc4f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,8 @@ ifeq ($(CC), clang)
            -Wno-unknown-warning-option        \
            -Wno-cast-align                    \
            -Wno-assign-enum                   \
-           -pedantic-errors
+           -pedantic-errors                   \
+           -fsanitize=address -fno-omit-frame-pointer
 else
        ifneq ($(CC), g++)
                CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
@@ -41,7 +42,7 @@ endif
 # do this last otherwise there is whitespace in the command output and
 # it makes my OCD act up
 CFLAGS += $(OPTIONAL_CFLAGS)
-LDFLAGS += $(OPTIONAL_LDFLAGS)
+LDFLAGS += $(OPTIONAL_LDFLAGS) -fsanitize=address -fno-omit-frame-pointer
 
 #we have duplicate object files when dealing with creating a simple list
 #for dependinces. To combat this we use some clever recrusive-make to
diff --git a/hash.c b/hash.c
index bc65b7f6821b2e33f0cd6434d2cef69dbb4e1da9..46edc743b26cbeab70ff4ebdd06f7b29793244df 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -22,6 +22,7 @@
  */
 #include "gmqcc.h"
 #include <limits.h>
+#include <string.h>
 
 #if defined(_MSC_VER)
 #   define HASH_ROTL32(X, Y) _rotl((X), (Y))
@@ -224,6 +225,7 @@ static GMQCC_FORCEINLINE uint32_t hash_murmur(const void *GMQCC_RESTRICT key, si
 }
 
 size_t hash(const char *key) {
+#if 0
     const char   *s = key;
     const char   *a = s;
     const size_t *w;
@@ -236,6 +238,9 @@ size_t hash(const char *key) {
     for (s = (const char *)w; *s; s++);
 
     return hash_murmur((const void *)key, s-a);
+#else
+    return hash_murmur((const void *)key, strlen(key));
+#endif
 }
 
 #undef HASH_ROTL32