Permalink
Browse files

Fix UB in test helpers

Macro expansion producing defined has undefined behavior in C/C++.
  • Loading branch information...
1 parent 3dcb288 commit 5add9b93d4c5365dd7e372741613864e2c549ae8 @nagisa nagisa committed Jan 16, 2017
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/rt/rust_test_helpers.c
@@ -269,10 +269,7 @@ LARGE_INTEGER increment_all_parts(LARGE_INTEGER li) {
return li;
}
-#define DO_INT128_TEST !(defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && \
- defined(__amd64__)
-
-#if DO_INT128_TEST
+#if !(defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && defined(__amd64__)
unsigned __int128 identity(unsigned __int128 a) {
return a;

0 comments on commit 5add9b9

Please sign in to comment.