You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by em...@apache.org on 2019/04/11 07:34:44 UTC

[arrow] branch master updated: ARROW-5160: [C++] Don't evaluate expression twice in ABORT_NOT_OK

This is an automated email from the ASF dual-hosted git repository.

emkornfield pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 264dc56  ARROW-5160: [C++] Don't evaluate expression twice in ABORT_NOT_OK
264dc56 is described below

commit 264dc56c93aeb52cda317a330a1a75234fc1fda5
Author: David Li <li...@gmail.com>
AuthorDate: Thu Apr 11 00:34:09 2019 -0700

    ARROW-5160: [C++] Don't evaluate expression twice in ABORT_NOT_OK
    
    This manifested itself as an abort in gRPC/Flight, as this macro was causing `WritesDone` to be called twice on a `ClientWriter`.
    
    Author: David Li <li...@gmail.com>
    
    Closes #4139 from lihalite/arrow-5160-abort-not-ok and squashes the following commits:
    
    b063742f <David Li> Don't evaluate expression twice in ABORT_NOT_OK
---
 cpp/src/arrow/testing/gtest_util.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpp/src/arrow/testing/gtest_util.h b/cpp/src/arrow/testing/gtest_util.h
index 88f3d12..e9b1634 100644
--- a/cpp/src/arrow/testing/gtest_util.h
+++ b/cpp/src/arrow/testing/gtest_util.h
@@ -83,13 +83,13 @@
     EXPECT_TRUE(s.ok());        \
   } while (false)
 
-#define ABORT_NOT_OK(s)                  \
-  do {                                   \
-    ::arrow::Status _s = (s);            \
-    if (ARROW_PREDICT_FALSE(!_s.ok())) { \
-      std::cerr << s.ToString() << "\n"; \
-      std::abort();                      \
-    }                                    \
+#define ABORT_NOT_OK(expr)                \
+  do {                                    \
+    ::arrow::Status _s = (expr);          \
+    if (ARROW_PREDICT_FALSE(!_s.ok())) {  \
+      std::cerr << _s.ToString() << "\n"; \
+      std::abort();                       \
+    }                                     \
   } while (false);
 
 namespace arrow {