diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/tools/fuzzing.h | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd0bedb9..005067e64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,4 +309,3 @@ IF (UNIX) # TODO: port to windows INSTALL(TARGETS wasm-reduce DESTINATION ${CMAKE_INSTALL_BINDIR}) ENDIF() - diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index d9acadbd1..982a94114 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -671,7 +671,7 @@ private: hangStack.push_back(nullptr); condition = makeCondition(); } - // we need to find a proper target to break to; try a few times + // we need to find a proper target to break to; try a few times int tries = TRIES; while (tries-- > 0) { auto* target = vectorPick(breakableStack); @@ -1352,12 +1352,26 @@ private: return first; } + // Trick to avoid a bug in GCC 7.x. + // Upstream bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82800 + #define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + #if GCC_VERSION > 70000 && GCC_VERSION < 70300 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" + #endif + template<typename T, typename... Args> T pickGivenNum(size_t num, T first, Args... args) { if (num == 0) return first; return pickGivenNum<T>(num - 1, args...); } + #if GCC_VERSION > 70000 && GCC_VERSION < 70300 + #pragma GCC diagnostic pop + #endif + // utilities Name getTargetName(Expression* target) { |