"Fossies" - the Fresh Open Source Software Archive

Member "knot-2.8.3/src/contrib/asan.h" (16 Jul 2019, 1467 Bytes) of package /linux/misc/dns/knot-2.8.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "asan.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.7.6_vs_2.8.0.

    1 /*  Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
    2 
    3     This program is free software: you can redistribute it and/or modify
    4     it under the terms of the GNU General Public License as published by
    5     the Free Software Foundation, either version 3 of the License, or
    6     (at your option) any later version.
    7 
    8     This program is distributed in the hope that it will be useful,
    9     but WITHOUT ANY WARRANTY; without even the implied warranty of
   10     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   11     GNU General Public License for more details.
   12 
   13     You should have received a copy of the GNU General Public License
   14     along with this program.  If not, see <https://www.gnu.org/licenses/>.
   15 */
   16 
   17 #pragma once
   18 
   19 /*
   20  * see sanitizer/asan_interface.h in compiler-rt (LLVM)
   21  */
   22 #ifndef __has_feature
   23   #define __has_feature(feature) 0
   24 #endif
   25 #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
   26   void __asan_poison_memory_region(void const volatile *addr, size_t size);
   27   void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
   28   #define ASAN_POISON_MEMORY_REGION(addr, size) \
   29     __asan_poison_memory_region((addr), (size))
   30   #define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
   31     __asan_unpoison_memory_region((addr), (size))
   32 #else
   33   #define ASAN_POISON_MEMORY_REGION(addr, size) \
   34     ((void)(addr), (void)(size))
   35   #define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
   36     ((void)(addr), (void)(size))
   37 #endif