-
Notifications
You must be signed in to change notification settings - Fork 1
Assert access checks #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Assert access checks #260
Conversation
… dominik/tt-1480-assert-more-counter-code
The access checks were a red herring. |
We still need the macro changes. |
@@ -16,6 +16,12 @@ | |||
recordreplay::Assert(format, ##__VA_ARGS__); \ | |||
static_assert(true, "require semicolon") | |||
|
|||
// Same as |REPLAY_ASSERT| but won't Assert if the given condition is not true. | |||
#define REPLAY_ASSERT_IF(cond, format, ...) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be defined in terms of one another?
e.g. REPLAY_ASSERT_IF
could be:
#define REPLAY_ASSERT_IF(cond, format, ...) \
if (cond) REPLAY_ASSERT(format, ##__VA_ARGS__)
and REPLAY_ASSERT_MAYBE_EVENTS_DISALLOWED
could be:
#define REPLAY_ASSERT_MAYBE_EVENTS_DISALLOWED(format, ...) \
REPLAY_ASSERT_IF(!recordreplay::AreEventsDisallowed(), format, ##__VA_ARGS__);
or REPLAY_ASSERT_IF
could be the one that's ultimately evaluated with REPLAY_ASSERT
being defined as:
#define REPLAY_ASSERT(format, ...) \
REPLAY_ASSERT_IF(true, format, ## __VA_ARGS__)
otherwise I'd be concerned about things diverging between the macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ❌Your first suggestion is a no-go, because suddenly you are evaluating
cond
even when things are enabled. - 🤷♀️ I don't like the unnecessary
if (true)
in your third suggestion. - ✅ I'm not concerned at all, since this is is going to be a very small set of often-used macros.
Uh oh!
There was an error while loading. Please reload this page.