Opened 3 years ago

Closed 3 years ago

#20141 closed defect (fixed)

Extra closing bracket in non-gcc IF_BUG_ONCE_

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.2.9.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: backport
Cc: Actual Points:
Parent ID: Points: 0.1
Reviewer: Sponsor:

Description

The 'IF_BUG_ONCE' for non-gcc is wrong. A simple patch:

--- a/util_bug.h 2016-09-13 10:44:59
+++ b/util_bug.h 2016-09-08 20:24:45
@@ -117,7 +117,7 @@
 #else
 #define IF_BUG_ONCE__(cond,var)                                         \
   static int var = 0;                                                   \
-  if (PREDICT_UNLIKELY(cond)) ?                                         \
+  if (PREDICT_UNLIKELY(cond) ?                                          \
       (var ? 1 :                                                        \
        (var=1,                                                          \
         tor_bug_occurred_(SHORT_FILE__, __LINE__, __func__,             \

Credit to Gisle Vanem, from this tor-dev post:
https://lists.torproject.org/pipermail/tor-dev/2016-September/011393.html

Child Tickets

Change History (2)

comment:1 Changed 3 years ago by nickm

Keywords: 029-proposed removed
Milestone: Tor: 0.2.???Tor: 0.2.9.x-final
Status: newneeds_review

comment:2 Changed 3 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

b88f918227bf88 adds a changes file and merges this. Not backporting, since IF_BUG_ONCE is new in 0.2.9.

Note: See TracTickets for help on using tickets.