https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125504

            Bug ID: 125504
           Summary: no_sanitize_address doesn't work when inlined by
                    always_inline
           Product: gcc
           Version: 16.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: services+gccbugs at vasama dot org
  Target Milestone: ---

This code reports a sanitizer failure despite the use of `no_sanitize_address`:

```
#include <sanitizer/asan_interface.h>

__attribute__((always_inline))
__attribute__((no_sanitize_address))
inline void assign(void** pp)
{
    *pp = 0;
}

int main()
{
    void* p = 0;
    __asan_poison_memory_region(&p, sizeof(p));
    assign(&p);
    __asan_unpoison_memory_region(&p, sizeof(p));
}
```

Live reproducer on Compiler Explorer: https://godbolt.org/z/1Ksd5qexM

Reply via email to