003 File Manager
Current Path:
/usr/src/contrib/llvm-project/compiler-rt/lib/ubsan
usr
/
src
/
contrib
/
llvm-project
/
compiler-rt
/
lib
/
ubsan
/
📁
..
📄
ubsan.syms.extra
(10 B)
📄
ubsan_checks.inc
(3.71 KB)
📄
ubsan_diag.cpp
(14.53 KB)
📄
ubsan_diag.h
(7.57 KB)
📄
ubsan_diag_standalone.cpp
(1.24 KB)
📄
ubsan_flags.cpp
(2.26 KB)
📄
ubsan_flags.h
(1.28 KB)
📄
ubsan_flags.inc
(1.25 KB)
📄
ubsan_handlers.cpp
(32.22 KB)
📄
ubsan_handlers.h
(7.12 KB)
📄
ubsan_handlers_cxx.cpp
(7.2 KB)
📄
ubsan_handlers_cxx.h
(2.1 KB)
📄
ubsan_init.cpp
(1.79 KB)
📄
ubsan_init.h
(1.06 KB)
📄
ubsan_init_standalone.cpp
(977 B)
📄
ubsan_init_standalone_preinit.cpp
(1.04 KB)
📄
ubsan_interface.inc
(3.25 KB)
📄
ubsan_monitor.cpp
(2.67 KB)
📄
ubsan_monitor.h
(1.72 KB)
📄
ubsan_platform.h
(952 B)
📄
ubsan_signals_standalone.cpp
(2.46 KB)
📄
ubsan_signals_standalone.h
(775 B)
📄
ubsan_type_hash.cpp
(1.25 KB)
📄
ubsan_type_hash.h
(2.73 KB)
📄
ubsan_type_hash_itanium.cpp
(9.47 KB)
📄
ubsan_type_hash_win.cpp
(2.82 KB)
📄
ubsan_value.cpp
(5.21 KB)
📄
ubsan_value.h
(6.04 KB)
📄
ubsan_win_dll_thunk.cpp
(1.02 KB)
📄
ubsan_win_dynamic_runtime_thunk.cpp
(952 B)
📄
ubsan_win_weak_interception.cpp
(1.15 KB)
📄
weak_symbols.txt
(25 B)
Editing: ubsan_flags.cpp
//===-- ubsan_flags.cpp ---------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Runtime flags for UndefinedBehaviorSanitizer. // //===----------------------------------------------------------------------===// #include "ubsan_platform.h" #if CAN_SANITIZE_UB #include "ubsan_flags.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include <stdlib.h> namespace __ubsan { const char *MaybeCallUbsanDefaultOptions() { return (&__ubsan_default_options) ? __ubsan_default_options() : ""; } static const char *GetFlag(const char *flag) { // We cannot call getenv() from inside a preinit array initializer if (SANITIZER_CAN_USE_PREINIT_ARRAY) { return GetEnv(flag); } else { return getenv(flag); } } Flags ubsan_flags; void Flags::SetDefaults() { #define UBSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "ubsan_flags.inc" #undef UBSAN_FLAG } void RegisterUbsanFlags(FlagParser *parser, Flags *f) { #define UBSAN_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(parser, #Name, Description, &f->Name); #include "ubsan_flags.inc" #undef UBSAN_FLAG } void InitializeFlags() { SetCommonFlagsDefaults(); { CommonFlags cf; cf.CopyFrom(*common_flags()); cf.external_symbolizer_path = GetFlag("UBSAN_SYMBOLIZER_PATH"); OverrideCommonFlags(cf); } Flags *f = flags(); f->SetDefaults(); FlagParser parser; RegisterCommonFlags(&parser); RegisterUbsanFlags(&parser, f); // Override from user-specified string. parser.ParseString(MaybeCallUbsanDefaultOptions()); // Override from environment variable. parser.ParseStringFromEnv("UBSAN_OPTIONS"); InitializeCommonFlags(); if (Verbosity()) ReportUnrecognizedFlags(); if (common_flags()->help) parser.PrintFlagDescriptions(); } } // namespace __ubsan SANITIZER_INTERFACE_WEAK_DEF(const char *, __ubsan_default_options, void) { return ""; } #endif // CAN_SANITIZE_UB
Upload File
Create Folder