Permalink
Browse files

Auto merge of #39095 - nagisa:fix-ub-in-testhelp, r=alexcrichton

Fix UB in test helpers

Macro expansion producing defined has undefined behavior in C/C++.
  • Loading branch information...
2 parents 7dfcac5 + 5add9b9 commit 0825c96b14f0b5eb59da1c36f70fe410c7c6fce7 @bors bors committed Jan 17, 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 0825c96

Please sign in to comment.