From 9c29a7590d277b7c811e51f3fd6cf160b60a5479 Mon Sep 17 00:00:00 2001 From: Nicholas Ormrod Date: Thu, 28 Apr 2016 10:41:19 -0700 Subject: [PATCH] Fix asan build Summary: The array-bounds checker in gcc complains that r could be -1 after leaving CHECK_ERR in ASAN mode. Switch to DCHECK to avoid this possibility. The code was not initially compiling; now it does. Error from gcc: array subscript is below array bounds [-Werror=array-bounds] Reviewed By: yfeldblum Differential Revision: D3232694 fb-gh-sync-id: 17f579eb152b661a8e5e4ed29ef91eec405fb90a fbshipit-source-id: 17f579eb152b661a8e5e4ed29ef91eec405fb90a --- folly/test/FileLockTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/test/FileLockTest.cpp b/folly/test/FileLockTest.cpp index 595c28c1..56d4ef7f 100644 --- a/folly/test/FileLockTest.cpp +++ b/folly/test/FileLockTest.cpp @@ -43,7 +43,7 @@ TEST(File, Locks) { static constexpr size_t pathLength = 2048; char buf[pathLength + 1]; int r = readlink("/proc/self/exe", buf, pathLength); - CHECK_ERR(r); + CHECK(r != -1); buf[r] = '\0'; fs::path me(buf); -- 2.34.1