diff options
| author | chenzizhan <[email protected]> | 2024-01-03 14:13:32 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2024-01-03 14:13:32 +0800 |
| commit | 185e3bfd2cf0c347ecdb4922390bf718a151c37f (patch) | |
| tree | 2a89027c0969b739022bd56bdd53e0af6688100e | |
| parent | 0bf6607642a8ce519edd805370bbe41405b2aeb1 (diff) | |
assert that can coredumpv4.4.7
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/tags/heavy_keeper.c | 5 | ||||
| -rw-r--r-- | src/tags/sorted_set.c | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6123eb4..4c2d6f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ if (CMAKE_CXX_CPPCHECK) "--suppress=shadowFunction"
"--suppress=shiftTooManyBitsSigned"
"--suppress=preprocessorErrorDirective"
+ "--suppress=nullPointer"
"--inline-suppr"
"--suppress=*:${PROJECT_SOURCE_DIR}/vendors/*"
"--suppress=*:${PROJECT_SOURCE_DIR}/test/utils.hpp"
diff --git a/src/tags/heavy_keeper.c b/src/tags/heavy_keeper.c index 5280cc0..877b73d 100644 --- a/src/tags/heavy_keeper.c +++ b/src/tags/heavy_keeper.c @@ -18,7 +18,10 @@ #include "tags/sorted_set.h" #include "tags/my_ut_hash.h" -#define assert(s) do { if (!(s)) { printf("assert failed: %s\n", #s); exit(1); } } while (0) +#define assert(s) do { if (!(s)) { printf("assert failed: %s\n", #s); \ + *((int *)0) = 0; \ + } \ + } while (0) struct Bucket { unsigned int finger_print; diff --git a/src/tags/sorted_set.c b/src/tags/sorted_set.c index b4f6d39..febd405 100644 --- a/src/tags/sorted_set.c +++ b/src/tags/sorted_set.c @@ -11,7 +11,10 @@ #include "sorted_set.h"
#include "my_ut_hash.h"
-#define assert(s) do { if (!(s)) { printf("assert failed: %s\n", #s); exit(1); } } while (0)
+#define assert(s) do { if (!(s)) { printf("assert failed: %s\n", #s); \
+ *((int *)0) = 0; \
+ } \
+ } while (0)
struct entry_data {
struct tag_hash_key *key;
|
