Skip to content

Commit

Permalink
Do not read __builtin_return_address when async stacks is disabled (#640
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jesswong authored Oct 29, 2024
1 parent 58419a1 commit c57bff3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/unifex/tracing/async_stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ struct instruction_ptr final {
// Generally a function that uses this macro should be declared FOLLY_NOINLINE
// to prevent this returning surprising results in cases where the function
// is inlined.
#if UNIFEX_HAS_BUILTIN(__builtin_return_address)
#if UNIFEX_HAS_BUILTIN(__builtin_return_address) && !UNIFEX_NO_ASYNC_STACKS
static constexpr instruction_ptr
read_return_address(void* p = __builtin_return_address(0)) noexcept {
#else
Expand Down Expand Up @@ -311,7 +311,7 @@ struct frame_ptr {
// Generally a function that uses this macro should be declared FOLLY_NOINLINE
// to prevent this returning surprising results in cases where the function
// is inlined.
#if UNIFEX_HAS_BUILTIN(__builtin_frame_address)
#if UNIFEX_HAS_BUILTIN(__builtin_frame_address) && !UNIFEX_NO_ASYNC_STACKS
static constexpr frame_ptr
read_frame_pointer(void* p = __builtin_frame_address(0)) noexcept {
#else
Expand Down

0 comments on commit c57bff3

Please sign in to comment.