Skip to content

Commit c9f1a72

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
Fix logic bug in JIT_CHECK_ONCE macro where check ran every time
Summary: The checked flag was only set to true in the else branch (reached when checked is already true), so it never actually became true and the "once" semantics were completely broken. Reviewed By: yoney Differential Revision: D94927042 fbshipit-source-id: b4a81c562542ebc29604f5a532032279853b1fc9
1 parent 607e15b commit c9f1a72

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

cinderx/Common/log.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ std::string repr(BorrowedRef<> obj);
7070
{ \
7171
static bool checked = false; \
7272
if (!checked) { \
73-
JIT_CHECK(COND, __VA_ARGS__); \
74-
} else { \
7573
checked = true; \
74+
JIT_CHECK(COND, __VA_ARGS__); \
7675
} \
7776
}
7877

0 commit comments

Comments
 (0)