Commit Graph

16 Commits

Author SHA1 Message Date
Vedant Kumar 8c4a65b9b2 [ubsan] Check implicit casts in ObjC for-in statements
Check that the implicit cast from `id` used to construct the element
variable in an ObjC for-in statement is valid.

This check is included as part of a new `objc-cast` sanitizer, outside
of the main 'undefined' group, as (IIUC) the behavior it's checking for
is not technically UB.

The check can be extended to cover other kinds of invalid casts in ObjC.

Partially addresses: rdar://12903059, rdar://9542496

Differential Revision: https://reviews.llvm.org/D71491
2020-07-13 15:11:18 -07:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Alexey Samsonov 0781e98cc7 [UBSan] Explicitly list all supported OS/arch pairs supported by UBSan.
llvm-svn: 233295
2015-03-26 17:26:04 +00:00
Alexey Samsonov 97c22f79e1 Enable UBSan on FreeBSD. Patch by Viktor Kutuzov.
llvm-svn: 202122
2014-02-25 08:29:36 +00:00
Alexey Samsonov c700e76278 [UBSan] Fix warning by specifying __extension__ before __int128
llvm-svn: 195648
2013-11-25 15:12:40 +00:00
Richard Smith b30d11194c ubsan: Pass floating-point arguments to the runtime by value if they fit the
value argument.

llvm-svn: 177689
2013-03-22 00:47:05 +00:00
Will Dietz 9d3209b5c7 [ubsan] Use __sanitizer::atomic_exchange(), prefer shared impl.
Specify weaker memory order in case we optimize for it in the future,
presently still doing same __sync_lock_test_and_set() as before.

Change suggested by Alexey Samsonov, thanks!

llvm-svn: 172429
2013-01-14 16:13:52 +00:00
Will Dietz b50565b21a [ubsan] Drop use of __atomic_exchange_n for now to fix build for some.
Need a more reliable way to check for support of this intrinsic.

llvm-svn: 171955
2013-01-09 06:18:40 +00:00
Will Dietz 765c266892 [ubsan] Add deduplication functionality, always enabled.
llvm-svn: 171948
2013-01-09 03:40:03 +00:00
Richard Smith 99507e6c10 ubsan: Don't assume that Clang provides __int128 unless it advertises that it does.
llvm-svn: 168857
2012-11-29 05:59:30 +00:00
Richard Smith 6122d0692b Support for building the ubsan runtime when using the autoconf build system on
Darwin. Patch by Jean-Daniel Dupas, tweaked by Jonathan Sauer, simplified
somewhat by me.

llvm-svn: 167889
2012-11-13 23:55:06 +00:00
Richard Smith 130b748b72 Use a better test for __int128 support, which works on old GCC versions.
llvm-svn: 165912
2012-10-14 23:28:55 +00:00
Chandler Carruth eea8a48218 Fix the bootstrap of CompilerRT with host compilers that don't support
emulating 128-bit arithmetic on 32-bit x86 targets. This should get the
bootstrap back for GCC 4.6 at least.

Suggestions on better ways to do the detection here are welcome...

llvm-svn: 165863
2012-10-13 02:30:10 +00:00
Richard Smith 7247b23efc -fcatch-undefined-behavior: Runtime library support for trapping conversions to or
from a floating-point type where the source value is not in the range of
representable values of the destination type.

llvm-svn: 165844
2012-10-12 22:57:15 +00:00
Richard Smith b6fb381dba -fcatch-undefined-behavior: store the type name directly at the end of a type descriptor. 5% binary size reduction due to fewer relocations.
llvm-svn: 165571
2012-10-09 23:55:18 +00:00
Richard Smith 68b3014cd3 Add a runtime diagnostics library for Clang's -fcatch-undefined-behavior.
llvm-svn: 165533
2012-10-09 19:34:32 +00:00