Go to file
Erik Pilkington 9c3b588db9 Add a new builtin: __builtin_dynamic_object_size
This builtin has the same UI as __builtin_object_size, but has the
potential to be evaluated dynamically. It is meant to be used as a
drop-in replacement for libraries that use __builtin_object_size when
a dynamic checking mode is enabled. For instance,
__builtin_object_size fails to provide any extra checking in the
following function:

  void f(size_t alloc) {
    char* p = malloc(alloc);
    strcpy(p, "foobar"); // expands to __builtin___strcpy_chk(p, "foobar", __builtin_object_size(p, 0))
  }

This is an overflow if alloc < 7, but because LLVM can't fold the
object size intrinsic statically, it folds __builtin_object_size to
-1. With __builtin_dynamic_object_size, alloc is passed through to
__builtin___strcpy_chk.

rdar://32212419

Differential revision: https://reviews.llvm.org/D56760

llvm-svn: 352665
2019-01-30 20:34:53 +00:00
clang Add a new builtin: __builtin_dynamic_object_size 2019-01-30 20:34:53 +00:00
clang-tools-extra [clangd] Drop fixes if replying with tweaks resulted in an error 2019-01-30 14:24:17 +00:00
compiler-rt [libFuzzer] remove stale code, NFC 2019-01-30 06:21:20 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
libcxx Revert "[CMake] Use correct visibility for linked libraries in CMake" 2019-01-30 19:51:18 +00:00
libcxxabi Revert "[CMake] Use correct visibility for linked libraries in CMake" 2019-01-30 19:51:18 +00:00
libunwind Revert "[CMake] Use correct visibility for linked libraries in CMake" 2019-01-30 19:51:18 +00:00
lld [WebAssembly] Fix crash with LTO + relocatable + undefined symbols 2019-01-30 18:55:15 +00:00
lldb Add LLDB website and documentation in reStructuredText for Sphinx 2019-01-30 18:51:40 +00:00
llgo Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
llvm Add a 'dynamic' parameter to the objectsize intrinsic 2019-01-30 20:34:35 +00:00
openmp [OMPT] Make sure that OMPT is enabled when accessing internals of the runtime 2019-01-30 08:41:06 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
pstl Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
.arcconfig Add an .arcconfig for the top of the git monorepo. 2019-01-11 16:27:14 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.