10b57cec5SDimitry Andric //===-- sanitizer/asan_interface.h ------------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file is a part of AddressSanitizer (ASan).
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric // Public interface header.
120b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
130b57cec5SDimitry Andric #ifndef SANITIZER_ASAN_INTERFACE_H
140b57cec5SDimitry Andric #define SANITIZER_ASAN_INTERFACE_H
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric #include <sanitizer/common_interface_defs.h>
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric #ifdef __cplusplus
190b57cec5SDimitry Andric extern "C" {
200b57cec5SDimitry Andric #endif
210b57cec5SDimitry Andric /// Marks a memory region (<c>[addr, addr+size)</c>) as unaddressable.
220b57cec5SDimitry Andric ///
230b57cec5SDimitry Andric /// This memory must be previously allocated by your program. Instrumented
240b57cec5SDimitry Andric /// code is forbidden from accessing addresses in this region until it is
250b57cec5SDimitry Andric /// unpoisoned. This function is not guaranteed to poison the entire region -
260b57cec5SDimitry Andric /// it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan
270b57cec5SDimitry Andric /// alignment restrictions.
280b57cec5SDimitry Andric ///
290b57cec5SDimitry Andric /// \note This function is not thread-safe because no two threads can poison or
300b57cec5SDimitry Andric /// unpoison memory in the same memory region simultaneously.
310b57cec5SDimitry Andric ///
320b57cec5SDimitry Andric /// \param addr Start of memory region.
330b57cec5SDimitry Andric /// \param size Size of memory region.
345f757f3fSDimitry Andric void SANITIZER_CDECL __asan_poison_memory_region(void const volatile *addr,
355f757f3fSDimitry Andric                                                  size_t size);
360b57cec5SDimitry Andric 
370b57cec5SDimitry Andric /// Marks a memory region (<c>[addr, addr+size)</c>) as addressable.
380b57cec5SDimitry Andric ///
390b57cec5SDimitry Andric /// This memory must be previously allocated by your program. Accessing
400b57cec5SDimitry Andric /// addresses in this region is allowed until this region is poisoned again.
410b57cec5SDimitry Andric /// This function could unpoison a super-region of <c>[addr, addr+size)</c> due
420b57cec5SDimitry Andric /// to ASan alignment restrictions.
430b57cec5SDimitry Andric ///
440b57cec5SDimitry Andric /// \note This function is not thread-safe because no two threads can
450b57cec5SDimitry Andric /// poison or unpoison memory in the same memory region simultaneously.
460b57cec5SDimitry Andric ///
470b57cec5SDimitry Andric /// \param addr Start of memory region.
480b57cec5SDimitry Andric /// \param size Size of memory region.
495f757f3fSDimitry Andric void SANITIZER_CDECL __asan_unpoison_memory_region(void const volatile *addr,
505f757f3fSDimitry Andric                                                    size_t size);
510b57cec5SDimitry Andric 
520b57cec5SDimitry Andric // Macros provided for convenience.
535f757f3fSDimitry Andric #ifdef __has_feature
545f757f3fSDimitry Andric #if __has_feature(address_sanitizer)
555f757f3fSDimitry Andric #define ASAN_DEFINE_REGION_MACROS
565f757f3fSDimitry Andric #endif
575f757f3fSDimitry Andric #elif defined(__SANITIZE_ADDRESS__)
585f757f3fSDimitry Andric #define ASAN_DEFINE_REGION_MACROS
595f757f3fSDimitry Andric #endif
605f757f3fSDimitry Andric 
615f757f3fSDimitry Andric #ifdef ASAN_DEFINE_REGION_MACROS
620b57cec5SDimitry Andric /// Marks a memory region as unaddressable.
630b57cec5SDimitry Andric ///
640b57cec5SDimitry Andric /// \note Macro provided for convenience; defined as a no-op if ASan is not
650b57cec5SDimitry Andric /// enabled.
660b57cec5SDimitry Andric ///
670b57cec5SDimitry Andric /// \param addr Start of memory region.
680b57cec5SDimitry Andric /// \param size Size of memory region.
690b57cec5SDimitry Andric #define ASAN_POISON_MEMORY_REGION(addr, size)                                  \
700b57cec5SDimitry Andric   __asan_poison_memory_region((addr), (size))
710b57cec5SDimitry Andric 
720b57cec5SDimitry Andric /// Marks a memory region as addressable.
730b57cec5SDimitry Andric ///
740b57cec5SDimitry Andric /// \note Macro provided for convenience; defined as a no-op if ASan is not
750b57cec5SDimitry Andric /// enabled.
760b57cec5SDimitry Andric ///
770b57cec5SDimitry Andric /// \param addr Start of memory region.
780b57cec5SDimitry Andric /// \param size Size of memory region.
790b57cec5SDimitry Andric #define ASAN_UNPOISON_MEMORY_REGION(addr, size)                                \
800b57cec5SDimitry Andric   __asan_unpoison_memory_region((addr), (size))
810b57cec5SDimitry Andric #else
825f757f3fSDimitry Andric #define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
835f757f3fSDimitry Andric #define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
840b57cec5SDimitry Andric #endif
855f757f3fSDimitry Andric #undef ASAN_DEFINE_REGION_MACROS
860b57cec5SDimitry Andric 
870b57cec5SDimitry Andric /// Checks if an address is poisoned.
880b57cec5SDimitry Andric ///
890b57cec5SDimitry Andric /// Returns 1 if <c><i>addr</i></c> is poisoned (that is, 1-byte read/write
900b57cec5SDimitry Andric /// access to this address would result in an error report from ASan).
910b57cec5SDimitry Andric /// Otherwise returns 0.
920b57cec5SDimitry Andric ///
930b57cec5SDimitry Andric /// \param addr Address to check.
940b57cec5SDimitry Andric ///
950b57cec5SDimitry Andric /// \retval 1 Address is poisoned.
960b57cec5SDimitry Andric /// \retval 0 Address is not poisoned.
975f757f3fSDimitry Andric int SANITIZER_CDECL __asan_address_is_poisoned(void const volatile *addr);
980b57cec5SDimitry Andric 
990b57cec5SDimitry Andric /// Checks if a region is poisoned.
1000b57cec5SDimitry Andric ///
1010b57cec5SDimitry Andric /// If at least one byte in <c>[beg, beg+size)</c> is poisoned, returns the
1020b57cec5SDimitry Andric /// address of the first such byte. Otherwise returns 0.
1030b57cec5SDimitry Andric ///
1040b57cec5SDimitry Andric /// \param beg Start of memory region.
1050b57cec5SDimitry Andric /// \param size Start of memory region.
1060b57cec5SDimitry Andric /// \returns Address of first poisoned byte.
1075f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_region_is_poisoned(void *beg, size_t size);
1080b57cec5SDimitry Andric 
1090b57cec5SDimitry Andric /// Describes an address (useful for calling from the debugger).
1100b57cec5SDimitry Andric ///
1110b57cec5SDimitry Andric /// Prints the description of <c><i>addr</i></c>.
1120b57cec5SDimitry Andric ///
1130b57cec5SDimitry Andric /// \param addr Address to describe.
1145f757f3fSDimitry Andric void SANITIZER_CDECL __asan_describe_address(void *addr);
1150b57cec5SDimitry Andric 
1160b57cec5SDimitry Andric /// Checks if an error has been or is being reported (useful for calling from
1170b57cec5SDimitry Andric /// the debugger to get information about an ASan error).
1180b57cec5SDimitry Andric ///
1190b57cec5SDimitry Andric /// Returns 1 if an error has been (or is being) reported. Otherwise returns 0.
1200b57cec5SDimitry Andric ///
1210b57cec5SDimitry Andric /// \returns 1 if an error has been (or is being) reported. Otherwise returns
1220b57cec5SDimitry Andric /// 0.
1235f757f3fSDimitry Andric int SANITIZER_CDECL __asan_report_present(void);
1240b57cec5SDimitry Andric 
1250b57cec5SDimitry Andric /// Gets the PC (program counter) register value of an ASan error (useful for
1260b57cec5SDimitry Andric /// calling from the debugger).
1270b57cec5SDimitry Andric ///
1280b57cec5SDimitry Andric /// Returns PC if an error has been (or is being) reported.
1290b57cec5SDimitry Andric /// Otherwise returns 0.
1300b57cec5SDimitry Andric ///
1310b57cec5SDimitry Andric /// \returns PC value.
1325f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_get_report_pc(void);
1330b57cec5SDimitry Andric 
1340b57cec5SDimitry Andric /// Gets the BP (base pointer) register value of an ASan error (useful for
1350b57cec5SDimitry Andric /// calling from the debugger).
1360b57cec5SDimitry Andric ///
1370b57cec5SDimitry Andric /// Returns BP if an error has been (or is being) reported.
1380b57cec5SDimitry Andric /// Otherwise returns 0.
1390b57cec5SDimitry Andric ///
1400b57cec5SDimitry Andric /// \returns BP value.
1415f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_get_report_bp(void);
1420b57cec5SDimitry Andric 
1430b57cec5SDimitry Andric /// Gets the SP (stack pointer) register value of an ASan error (useful for
1440b57cec5SDimitry Andric /// calling from the debugger).
1450b57cec5SDimitry Andric ///
1460b57cec5SDimitry Andric /// If an error has been (or is being) reported, returns SP.
1470b57cec5SDimitry Andric /// Otherwise returns 0.
1480b57cec5SDimitry Andric ///
1490b57cec5SDimitry Andric /// \returns SP value.
1505f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_get_report_sp(void);
1510b57cec5SDimitry Andric 
1520b57cec5SDimitry Andric /// Gets the address of the report buffer of an ASan error (useful for calling
1530b57cec5SDimitry Andric /// from the debugger).
1540b57cec5SDimitry Andric ///
1550b57cec5SDimitry Andric /// Returns the address of the report buffer if an error has been (or is being)
1560b57cec5SDimitry Andric /// reported. Otherwise returns 0.
1570b57cec5SDimitry Andric ///
1580b57cec5SDimitry Andric /// \returns Address of report buffer.
1595f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_get_report_address(void);
1600b57cec5SDimitry Andric 
1610b57cec5SDimitry Andric /// Gets access type of an ASan error (useful for calling from the debugger).
1620b57cec5SDimitry Andric ///
1630b57cec5SDimitry Andric /// Returns access type (read or write) if an error has been (or is being)
1640b57cec5SDimitry Andric /// reported. Otherwise returns 0.
1650b57cec5SDimitry Andric ///
1660b57cec5SDimitry Andric /// \returns Access type (0 = read, 1 = write).
1675f757f3fSDimitry Andric int SANITIZER_CDECL __asan_get_report_access_type(void);
1680b57cec5SDimitry Andric 
1690b57cec5SDimitry Andric /// Gets access size of an ASan error (useful for calling from the debugger).
1700b57cec5SDimitry Andric ///
1710b57cec5SDimitry Andric /// Returns access size if an error has been (or is being) reported. Otherwise
1720b57cec5SDimitry Andric /// returns 0.
1730b57cec5SDimitry Andric ///
1740b57cec5SDimitry Andric /// \returns Access size in bytes.
1755f757f3fSDimitry Andric size_t SANITIZER_CDECL __asan_get_report_access_size(void);
1760b57cec5SDimitry Andric 
1770b57cec5SDimitry Andric /// Gets the bug description of an ASan error (useful for calling from a
1780b57cec5SDimitry Andric /// debugger).
1790b57cec5SDimitry Andric ///
1800b57cec5SDimitry Andric /// \returns Returns a bug description if an error has been (or is being)
1810b57cec5SDimitry Andric /// reported - for example, "heap-use-after-free". Otherwise returns an empty
1820b57cec5SDimitry Andric /// string.
1835f757f3fSDimitry Andric const char *SANITIZER_CDECL __asan_get_report_description(void);
1840b57cec5SDimitry Andric 
1850b57cec5SDimitry Andric /// Gets information about a pointer (useful for calling from the debugger).
1860b57cec5SDimitry Andric ///
1870b57cec5SDimitry Andric /// Returns the category of the given pointer as a constant string.
1880b57cec5SDimitry Andric /// Possible return values are <c>global</c>, <c>stack</c>, <c>stack-fake</c>,
1890b57cec5SDimitry Andric /// <c>heap</c>, <c>heap-invalid</c>, <c>shadow-low</c>, <c>shadow-gap</c>,
1900b57cec5SDimitry Andric /// <c>shadow-high</c>, and <c>unknown</c>.
1910b57cec5SDimitry Andric ///
1920b57cec5SDimitry Andric /// If the return value is <c>global</c> or <c>stack</c>, tries to also return
1930b57cec5SDimitry Andric /// the variable name, address, and size. If the return value is <c>heap</c>,
1940b57cec5SDimitry Andric /// tries to return the chunk address and size. <c><i>name</i></c> should point
1950b57cec5SDimitry Andric /// to an allocated buffer of size <c><i>name_size</i></c>.
1960b57cec5SDimitry Andric ///
1970b57cec5SDimitry Andric /// \param addr Address to locate.
1980b57cec5SDimitry Andric /// \param name Buffer to store the variable's name.
1990b57cec5SDimitry Andric /// \param name_size Size in bytes of the variable's name buffer.
200e8d8bef9SDimitry Andric /// \param[out] region_address Address of the region.
201e8d8bef9SDimitry Andric /// \param[out] region_size Size of the region in bytes.
2020b57cec5SDimitry Andric ///
2030b57cec5SDimitry Andric /// \returns Returns the category of the given pointer as a constant string.
2045f757f3fSDimitry Andric const char *SANITIZER_CDECL __asan_locate_address(void *addr, char *name,
2055f757f3fSDimitry Andric                                                   size_t name_size,
2065f757f3fSDimitry Andric                                                   void **region_address,
2075f757f3fSDimitry Andric                                                   size_t *region_size);
2080b57cec5SDimitry Andric 
2090b57cec5SDimitry Andric /// Gets the allocation stack trace and thread ID for a heap address (useful
2100b57cec5SDimitry Andric /// for calling from the debugger).
2110b57cec5SDimitry Andric ///
2120b57cec5SDimitry Andric /// Stores up to <c><i>size</i></c> frames in <c><i>trace</i></c>. Returns
2130b57cec5SDimitry Andric /// the number of stored frames or 0 on error.
2140b57cec5SDimitry Andric ///
2150b57cec5SDimitry Andric /// \param addr A heap address.
2160b57cec5SDimitry Andric /// \param trace A buffer to store the stack trace.
2170b57cec5SDimitry Andric /// \param size Size in bytes of the trace buffer.
218e8d8bef9SDimitry Andric /// \param[out] thread_id The thread ID of the address.
2190b57cec5SDimitry Andric ///
2200b57cec5SDimitry Andric /// \returns Returns the number of stored frames or 0 on error.
2215f757f3fSDimitry Andric size_t SANITIZER_CDECL __asan_get_alloc_stack(void *addr, void **trace,
2225f757f3fSDimitry Andric                                               size_t size, int *thread_id);
2230b57cec5SDimitry Andric 
2240b57cec5SDimitry Andric /// Gets the free stack trace and thread ID for a heap address (useful for
2250b57cec5SDimitry Andric /// calling from the debugger).
2260b57cec5SDimitry Andric ///
2270b57cec5SDimitry Andric /// Stores up to <c><i>size</i></c> frames in <c><i>trace</i></c>. Returns
2280b57cec5SDimitry Andric /// the number of stored frames or 0 on error.
2290b57cec5SDimitry Andric ///
2300b57cec5SDimitry Andric /// \param addr A heap address.
2310b57cec5SDimitry Andric /// \param trace A buffer to store the stack trace.
2320b57cec5SDimitry Andric /// \param size Size in bytes of the trace buffer.
233e8d8bef9SDimitry Andric /// \param[out] thread_id The thread ID of the address.
2340b57cec5SDimitry Andric ///
2350b57cec5SDimitry Andric /// \returns Returns the number of stored frames or 0 on error.
2365f757f3fSDimitry Andric size_t SANITIZER_CDECL __asan_get_free_stack(void *addr, void **trace,
2375f757f3fSDimitry Andric                                              size_t size, int *thread_id);
2380b57cec5SDimitry Andric 
2390b57cec5SDimitry Andric /// Gets the current shadow memory mapping (useful for calling from the
2400b57cec5SDimitry Andric /// debugger).
2410b57cec5SDimitry Andric ///
242e8d8bef9SDimitry Andric /// \param[out] shadow_scale Shadow scale value.
243e8d8bef9SDimitry Andric /// \param[out] shadow_offset Offset value.
2445f757f3fSDimitry Andric void SANITIZER_CDECL __asan_get_shadow_mapping(size_t *shadow_scale,
2455f757f3fSDimitry Andric                                                size_t *shadow_offset);
2460b57cec5SDimitry Andric 
2470b57cec5SDimitry Andric /// This is an internal function that is called to report an error. However,
2480b57cec5SDimitry Andric /// it is still a part of the interface because you might want to set a
2490b57cec5SDimitry Andric /// breakpoint on this function in the debugger.
2500b57cec5SDimitry Andric ///
2510b57cec5SDimitry Andric /// \param pc <c><i>pc</i></c> value of the ASan error.
2520b57cec5SDimitry Andric /// \param bp <c><i>bp</i></c> value of the ASan error.
2530b57cec5SDimitry Andric /// \param sp <c><i>sp</i></c> value of the ASan error.
2540b57cec5SDimitry Andric /// \param addr Address of the ASan error.
2550b57cec5SDimitry Andric /// \param is_write True if the error is a write error; false otherwise.
2560b57cec5SDimitry Andric /// \param access_size Size of the memory access of the ASan error.
2575f757f3fSDimitry Andric void SANITIZER_CDECL __asan_report_error(void *pc, void *bp, void *sp,
2585f757f3fSDimitry Andric                                          void *addr, int is_write,
2595f757f3fSDimitry Andric                                          size_t access_size);
2600b57cec5SDimitry Andric 
2610b57cec5SDimitry Andric // Deprecated. Call __sanitizer_set_death_callback instead.
2625f757f3fSDimitry Andric void SANITIZER_CDECL __asan_set_death_callback(void (*callback)(void));
2630b57cec5SDimitry Andric 
2640b57cec5SDimitry Andric /// Sets the callback function to be called during ASan error reporting.
2650b57cec5SDimitry Andric ///
2660b57cec5SDimitry Andric /// The callback provides a string pointer to the report.
2670b57cec5SDimitry Andric ///
2680b57cec5SDimitry Andric /// \param callback User-provided function.
2695f757f3fSDimitry Andric void SANITIZER_CDECL
2705f757f3fSDimitry Andric __asan_set_error_report_callback(void (*callback)(const char *));
2710b57cec5SDimitry Andric 
2720b57cec5SDimitry Andric /// User-provided callback on ASan errors.
2730b57cec5SDimitry Andric ///
2740b57cec5SDimitry Andric /// You can provide a function that would be called immediately when ASan
2750b57cec5SDimitry Andric /// detects an error. This is useful in cases when ASan detects an error but
2760b57cec5SDimitry Andric /// your program crashes before the ASan report is printed.
2775f757f3fSDimitry Andric void SANITIZER_CDECL __asan_on_error(void);
2780b57cec5SDimitry Andric 
2790b57cec5SDimitry Andric /// Prints accumulated statistics to <c>stderr</c> (useful for calling from the
2800b57cec5SDimitry Andric /// debugger).
2815f757f3fSDimitry Andric void SANITIZER_CDECL __asan_print_accumulated_stats(void);
2820b57cec5SDimitry Andric 
2830b57cec5SDimitry Andric /// User-provided default option settings.
2840b57cec5SDimitry Andric ///
2850b57cec5SDimitry Andric /// You can provide your own implementation of this function to return a string
2860b57cec5SDimitry Andric /// containing ASan runtime options (for example,
2870b57cec5SDimitry Andric /// <c>verbosity=1:halt_on_error=0</c>).
2880b57cec5SDimitry Andric ///
2890b57cec5SDimitry Andric /// \returns Default options string.
2905f757f3fSDimitry Andric const char *SANITIZER_CDECL __asan_default_options(void);
2910b57cec5SDimitry Andric 
2920b57cec5SDimitry Andric // The following two functions facilitate garbage collection in presence of
2930b57cec5SDimitry Andric // ASan's fake stack.
2940b57cec5SDimitry Andric 
2950b57cec5SDimitry Andric /// Gets an opaque handler to the current thread's fake stack.
2960b57cec5SDimitry Andric ///
2970b57cec5SDimitry Andric /// Returns an opaque handler to be used by
2980b57cec5SDimitry Andric /// <c>__asan_addr_is_in_fake_stack()</c>. Returns NULL if the current thread
2990b57cec5SDimitry Andric /// does not have a fake stack.
3000b57cec5SDimitry Andric ///
3010b57cec5SDimitry Andric /// \returns An opaque handler to the fake stack or NULL.
3025f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_get_current_fake_stack(void);
3030b57cec5SDimitry Andric 
3040b57cec5SDimitry Andric /// Checks if an address belongs to a given fake stack.
3050b57cec5SDimitry Andric ///
3060b57cec5SDimitry Andric /// If <c><i>fake_stack</i></c> is non-NULL and <c><i>addr</i></c> belongs to a
3070b57cec5SDimitry Andric /// fake frame in <c><i>fake_stack</i></c>, returns the address of the real
3080b57cec5SDimitry Andric /// stack that corresponds to the fake frame and sets <c><i>beg</i></c> and
3090b57cec5SDimitry Andric /// <c><i>end</i></c> to the boundaries of this fake frame. Otherwise returns
3100b57cec5SDimitry Andric /// NULL and does not touch <c><i>beg</i></c> and <c><i>end</i></c>.
3110b57cec5SDimitry Andric ///
3120b57cec5SDimitry Andric /// If <c><i>beg</i></c> or <c><i>end</i></c> are NULL, they are not touched.
3130b57cec5SDimitry Andric ///
3140b57cec5SDimitry Andric /// \note This function can be called from a thread other than the owner of
3150b57cec5SDimitry Andric /// <c><i>fake_stack</i></c>, but the owner thread needs to be alive.
3160b57cec5SDimitry Andric ///
3170b57cec5SDimitry Andric /// \param fake_stack An opaque handler to a fake stack.
3180b57cec5SDimitry Andric /// \param addr Address to test.
319e8d8bef9SDimitry Andric /// \param[out] beg Beginning of fake frame.
320e8d8bef9SDimitry Andric /// \param[out] end End of fake frame.
3210b57cec5SDimitry Andric /// \returns Stack address or NULL.
3225f757f3fSDimitry Andric void *SANITIZER_CDECL __asan_addr_is_in_fake_stack(void *fake_stack, void *addr,
3235f757f3fSDimitry Andric                                                    void **beg, void **end);
3240b57cec5SDimitry Andric 
3250b57cec5SDimitry Andric /// Performs shadow memory cleanup of the current thread's stack before a
3260b57cec5SDimitry Andric /// function marked with the <c>[[noreturn]]</c> attribute is called.
3270b57cec5SDimitry Andric ///
3280b57cec5SDimitry Andric /// To avoid false positives on the stack, must be called before no-return
3290b57cec5SDimitry Andric /// functions like <c>_exit()</c> and <c>execl()</c>.
3305f757f3fSDimitry Andric void SANITIZER_CDECL __asan_handle_no_return(void);
3310b57cec5SDimitry Andric 
332480093f4SDimitry Andric /// Update allocation stack trace for the given allocation to the current stack
333349cc55cSDimitry Andric /// trace. Returns 1 if successful, 0 if not.
3345f757f3fSDimitry Andric int SANITIZER_CDECL __asan_update_allocation_context(void *addr);
335480093f4SDimitry Andric 
3360b57cec5SDimitry Andric #ifdef __cplusplus
3370b57cec5SDimitry Andric } // extern "C"
3380b57cec5SDimitry Andric #endif
3390b57cec5SDimitry Andric 
3400b57cec5SDimitry Andric #endif // SANITIZER_ASAN_INTERFACE_H
341