Skip to content

Commit

Permalink
fix build errors in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
apache-hb committed Sep 13, 2024
1 parent 3e1c506 commit 517e1de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/cthulhu/tree/src/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ bool tree_has_vis(const tree_t *self, tree_visibility_t visibility)
/// quals
///

#define EXPECT_STORAGE_DECL(SELF) CTASSERTF(tree_has_storage(SELF), "only globals and locals can have storage, got %s", tree_to_string(SELF))
#if CTU_DEBUG
# define EXPECT_STORAGE_DECL(SELF) CTASSERTF(tree_has_storage(SELF), "only globals and locals can have storage, got %s", tree_to_string(SELF))
#else
# define EXPECT_STORAGE_DECL(SELF) (void)0
#endif

bool tree_has_storage(const tree_t *self)
{
Expand Down
9 changes: 3 additions & 6 deletions src/support/format/src/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@ typedef struct collapsed_t
unsigned repeat;
} collapsed_t;

static bool is_collapsed_range(collapsed_t collapsed)
{
return collapsed.repeat != 0;
}
#define IS_COLLAPSED_RANGE(it) ((it).repeat != 0)

static const entry_t *get_collapsed_entry(const backtrace_t *self, collapsed_t range)
{
CTASSERTF(!is_collapsed_range(range), "range is not a single frame");
CTASSERTF(!IS_COLLAPSED_RANGE(range), "range is not a single frame");

return typevec_offset(self->entries, range.first);
}
Expand Down Expand Up @@ -472,7 +469,7 @@ void fmt_backtrace(fmt_backtrace_t fmt, bt_report_t *report)
}
else
{
if (!is_collapsed_range(*frame))
if (!IS_COLLAPSED_RANGE(*frame))
{
size_t remaining = frame_count - i;
symbol_align = get_largest_collapsed_symbol(report->frames, frame, remaining);
Expand Down

0 comments on commit 517e1de

Please sign in to comment.