|
| 1 | +diff -urN mergesat-3.0.orig/core/OnlineProofChecker.h mergesat-3.0/core/OnlineProofChecker.h |
| 2 | +--- mergesat-3.0.orig/core/OnlineProofChecker.h 2021-03-25 07:15:00.000000000 +0000 |
| 3 | ++++ mergesat-3.0/core/OnlineProofChecker.h 2021-11-04 09:43:19.934897933 +0000 |
| 4 | +@@ -832,6 +832,6 @@ |
| 5 | + } |
| 6 | + } |
| 7 | + |
| 8 | +-}; // namespace MERGESAT_NSPACE |
| 9 | ++} // namespace MERGESAT_NSPACE |
| 10 | + |
| 11 | + #endif |
| 12 | +diff -urN mergesat-3.0.orig/core/Solver.cc mergesat-3.0/core/Solver.cc |
| 13 | +--- mergesat-3.0.orig/core/Solver.cc 2021-03-25 07:15:00.000000000 +0000 |
| 14 | ++++ mergesat-3.0/core/Solver.cc 2021-11-04 10:04:45.252778350 +0000 |
| 15 | +@@ -215,22 +215,22 @@ |
| 16 | + if (!args) return false; |
| 17 | + char *original_args = args; |
| 18 | + |
| 19 | +- const size_t len = strlen(args); |
| 20 | ++ std::vector<char *> argv; |
| 21 | ++ argv.push_back(strdup("mergesat")); |
| 22 | + |
| 23 | +- char *argv[len + 2]; |
| 24 | +- int count = 1; |
| 25 | +- |
| 26 | +- argv[0] = "mergesat"; |
| 27 | + while (isspace(*args)) ++args; |
| 28 | + while (*args) { |
| 29 | +- argv[count++] = args; // store current argument |
| 30 | ++ argv.push_back(args); // store current argument |
| 31 | + while (*args && !isspace(*args)) ++args; // skip current token |
| 32 | + if (!*args) break; |
| 33 | + *args = (char)0; // separate current token |
| 34 | + ++args; |
| 35 | + } |
| 36 | + |
| 37 | +- parseOptions(count, argv, false); |
| 38 | ++ argv.push_back(NULL); |
| 39 | ++ |
| 40 | ++ int count = argv.size() - 1; |
| 41 | ++ parseOptions(count, argv.data(), false); |
| 42 | + free(original_args); |
| 43 | + return false; |
| 44 | + } |
| 45 | +@@ -2601,7 +2601,7 @@ |
| 46 | + |
| 47 | + /* grow limit after each rephasing */ |
| 48 | + state_change_time = state_change_time + state_change_time_inc; |
| 49 | +- state_change_time_inc = state_change_time_inc *= state_change_time_inc_inc; |
| 50 | ++ state_change_time_inc *= state_change_time_inc_inc; |
| 51 | + |
| 52 | + /* actually rephase */ |
| 53 | + if (rand() % 100 < 50) |
| 54 | +@@ -3042,7 +3042,8 @@ |
| 55 | + order_heap_CHB.build(order_heap_DISTANCE.elements()); |
| 56 | + order_heap = &order_heap_CHB; |
| 57 | + break; |
| 58 | +- default: |
| 59 | ++ case VSIDS_CHB: |
| 60 | ++ case CHB: |
| 61 | + break; |
| 62 | + } |
| 63 | + assert(!considersDISTANCE() && "we should have disabled DISTANCE heuristic"); |
| 64 | +@@ -3062,7 +3063,8 @@ |
| 65 | + order_heap_DISTANCE.build(order_heap_CHB.elements()); |
| 66 | + order_heap = &order_heap_DISTANCE; |
| 67 | + break; |
| 68 | +- default: |
| 69 | ++ case VSIDS_DISTANCE: |
| 70 | ++ case DISTANCE: |
| 71 | + break; |
| 72 | + } |
| 73 | + assert(considersDISTANCE() && "we should have enabled DISTANCE heuristic"); |
| 74 | +diff -urN mergesat-3.0.orig/core/SolverTypes.h mergesat-3.0/core/SolverTypes.h |
| 75 | +--- mergesat-3.0.orig/core/SolverTypes.h 2021-03-25 07:15:00.000000000 +0000 |
| 76 | ++++ mergesat-3.0/core/SolverTypes.h 2021-11-04 09:47:03.613323317 +0000 |
| 77 | +@@ -187,6 +187,16 @@ |
| 78 | + unsigned onQueue : 1; |
| 79 | + unsigned size : 30; |
| 80 | + } header; |
| 81 | ++#if defined __clang__ |
| 82 | ++ #pragma clang diagnostic push |
| 83 | ++ #pragma clang diagnostic ignored "-Wzero-length-array" |
| 84 | ++#elif defined __GNUC__ |
| 85 | ++ #pragma GCC diagnostic push |
| 86 | ++ #pragma GCC diagnostic ignored "-Wpedantic" // no specific ZLA warning in GCC |
| 87 | ++#elif defined _MSC_VER |
| 88 | ++ #pragma warning(push) |
| 89 | ++ #pragma warning(disable:4200) |
| 90 | ++#endif |
| 91 | + union { |
| 92 | + Lit lit; |
| 93 | + float act; |
| 94 | +@@ -194,6 +204,13 @@ |
| 95 | + uint32_t touched; |
| 96 | + CRef rel; |
| 97 | + } data[0]; |
| 98 | ++#if defined __clang__ |
| 99 | ++ #pragma clang diagnostic pop |
| 100 | ++#elif defined __GNUC__ |
| 101 | ++ #pragma GCC diagnostic pop |
| 102 | ++#elif defined _MSC_VER |
| 103 | ++ #pragma warning(pop) |
| 104 | ++#endif |
| 105 | + |
| 106 | + friend class ClauseAllocator; |
| 107 | + |
| 108 | +diff --git a/minisat/mtl/Vec.h b/minisat/mtl/Vec.h |
| 109 | +--- a/minisat/mtl/Vec.h |
| 110 | ++++ b/minisat/mtl/Vec.h |
| 111 | +@@ -159,8 +159,7 @@ |
| 112 | + int add = imax((min_cap - cap + 1) & ~1, ((cap >> 1) + 2) & ~1); // NOTE: grow by approximately 3/2 |
| 113 | + if (add > INT_MAX - cap) throw OutOfMemoryException(); |
| 114 | + |
| 115 | +- T *newdata = (T *)::realloc(data, (cap + add) * sizeof(T)); |
| 116 | ++ T *newdata = (T *)xrealloc(data, (cap + add) * sizeof(T)); |
| 117 | +- if (newdata == NULL && errno == ENOMEM) throw OutOfMemoryException(); |
| 118 | + |
| 119 | + cap += add; |
| 120 | + data = newdata; |
| 121 | +diff --git a/minisat/mtl/XAlloc.h b/minisat/mtl/XAlloc.h |
| 122 | +--- a/minisat/mtl/XAlloc.h |
| 123 | ++++ b/minisat/mtl/XAlloc.h |
| 124 | +@@ -21,7 +21,6 @@ |
| 125 | + #ifndef MergeSat_XAlloc_h |
| 126 | + #define MergeSat_XAlloc_h |
| 127 | + |
| 128 | +-#include <errno.h> |
| 129 | + #include <stdlib.h> |
| 130 | + |
| 131 | + // To not introduce this multiple times, use this header, as it's rather central |
| 132 | +@@ -41,7 +40,7 @@ |
| 133 | + static inline void *xrealloc(void *ptr, size_t size) |
| 134 | + { |
| 135 | + void *mem = realloc(ptr, size); |
| 136 | +- if (mem == NULL && errno == ENOMEM) { |
| 137 | ++ if (mem == NULL) { |
| 138 | + throw OutOfMemoryException(); |
| 139 | + } else |
| 140 | + return mem; |
0 commit comments