| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 223191
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change makes CodeGenFunction::EmitCheck() take several
conditions that needs to be checked (all of them need to be true),
together with sanitizer kinds these checks are for. This would allow
to split one call into UBSan runtime into several calls in case
different sanitizer kinds would have different recoverability
settings.
Tests should be fixed accordingly, I'm working on it.
Test Plan: regression test suite.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6219
llvm-svn: 221716
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds UBSan check to upcasts. Namely, when we
perform derived-to-base conversion, we:
1) check that the pointer-to-derived has suitable alignment
and underlying storage, if this pointer is non-null.
2) if vptr-sanitizer is enabled, and we perform conversion to
virtual base, we check that pointer-to-derived has a matching vptr.
llvm-svn: 219642
|
|
|
|
|
|
|
|
|
|
| |
Otherwise -fsanitize=vptr causes the program to crash when it downcasts
a null pointer.
Reviewed in http://reviews.llvm.org/D4412.
Patch by Byoungyoung Lee!
llvm-svn: 213393
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change adds description of globals created by UBSan
instrumentation (UBSan handlers, type descriptors, filenames) to
llvm.asan.globals metadata, effectively "blacklisting" them. This can
dramatically decrease the data section in binaries built with UBSan+ASan,
as UBSan tends to create a lot of handlers, and ASan instrumentation
increases the global size to at least 64 bytes.
Test Plan: clang regression test suite
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits, byoungyoung, kcc
Differential Revision: http://reviews.llvm.org/D4575
llvm-svn: 213392
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because references must be initialized using some evaluated expression, they
must point to something, and a callee can assume the reference parameter is
dereferenceable. Taking advantage of a new attribute just added to LLVM, mark
them as such.
Because dereferenceability in addrspace(0) implies nonnull in the backend, we
don't need both attributes. However, we need to know the size of the object to
use the dereferenceable attribute, so for incomplete types we still emit only
nonnull.
llvm-svn: 213386
|
|
|
|
| |
llvm-svn: 213334
|
|
|
|
|
|
| |
type in a function type where the C++ type is a reference. Update the tests.
llvm-svn: 209723
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
check using the ubsan runtime) and -fsanitize=local-bounds (for the middle-end
check which inserts traps).
Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not produce
useful diagnostics and has false positives (PR17635), and is not a good
compromise position between UBSan's checks and ASan's checks.
Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's historical
behavior for that flag.
llvm-svn: 193205
|
|
|
|
|
|
|
|
|
| |
This uses function prefix data to store function type information at the
function pointer.
Differential Revision: http://llvm-reviews.chandlerc.com/D1338
llvm-svn: 193058
|
|
|
|
| |
llvm-svn: 192120
|
|
|
|
|
|
| |
constructor, copy assignment operator and move assignment operator.
llvm-svn: 190481
|
|
|
|
|
|
| |
tests fail.
llvm-svn: 188447
|
|
|
|
| |
llvm-svn: 187952
|
|
|
|
| |
llvm-svn: 187951
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
UBSan was checking for alignment of the derived class on the pointer to
the base class, before converting. With some class hierarchies, this could
generate false positives.
Added test-case.
llvm-svn: 187948
|
|
|
|
|
|
| |
Avoids warning twice on same shift.
llvm-svn: 176056
|
|
|
|
|
|
| |
array type.
llvm-svn: 175982
|
|
|
|
|
|
| |
really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information.
llvm-svn: 175949
|
|
|
|
|
|
| |
attributes on the call/invoke instructions.
llvm-svn: 175878
|
|
|
|
|
|
|
| |
base-to-derived casts have undefined behavior if the object is not actually an
instance of the derived type.
llvm-svn: 175078
|
|
|
|
| |
llvm-svn: 171264
|
|
|
|
|
|
| |
to an object outside its lifetime does not have undefined behavior.
llvm-svn: 170387
|
|
|
|
|
|
|
| |
bit-patterns which are not valid values for enumerated or boolean types.
These checks are the ubsan analogue of !range metadata.
llvm-svn: 170108
|
|
|
|
| |
llvm-svn: 169114
|
|
|
|
|
|
| |
Introduces new sanitizer "unsigned-integer-overflow".
llvm-svn: 168701
|
|
|
|
|
|
|
| |
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.
llvm-svn: 167413
|
|
|
|
| |
llvm-svn: 166735
|
|
|
|
|
|
| |
for 32- and 64-bit host compilers. This really needs to be fixed -- the IR generated should not depend on the host -- but this change will get the bots green again. Proper fix to follow.
llvm-svn: 166731
|
|
|
|
| |
llvm-svn: 166727
|
|
|
|
|
|
| |
of the checks fails.
llvm-svn: 165536
|
|
|
|
|
|
|
|
| |
- outside C++, return undef (behavior is not undefined unless the value is used)
- in C++, with -fcatch-undefined-behavior, perform an appropriate trap
- in C++, produce an 'unreachable' (behavior is undefined immediately)
llvm-svn: 165273
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
by this mode, and also check for signed left shift overflow. The rules for the
latter are a little subtle:
* neither C89 nor C++98 specify the behavior of a signed left shift at all
* in C99 and C11, shifting a 1 bit into the sign bit has undefined behavior
* in C++11, with core issue 1457, shifting a 1 bit *out* of the sign bit has
undefined behavior
As of this change, we use the C99 rules for all C language variants, and the
C++11 rules for all C++ language variants. Once we have individual
-fcatch-undefined-behavior= flags, this should be revisited.
llvm-svn: 162634
|
|
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check
* check that references are bound to appropriate storage
* check that 'this' has appropriate storage in member accesses and member function calls
llvm-svn: 162523
|