folly: #define UNDEFINED_SANITIZER in ubsan mode
[folly.git] / folly / test / MemcpyTest.cpp
index badd344718fceb5dbc86fb4d18b9e9cbd4d8e96f..73b64ca10fa7dea554d5e06caa1761758b797ca9 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <folly/Portability.h>
+
 #include <gtest/gtest.h>
 
 namespace {
@@ -30,7 +32,7 @@ void init() {
 }
 }
 
-TEST(memcpy, zero_len) {
+TEST(memcpy, zero_len) UBSAN_DISABLE("nonnull-attribute") {
   // If length is 0, we shouldn't touch any memory.  So this should
   // not crash.
   char* srcNull = nullptr;