summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_libc.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/sanitizer_common to .cppNico Weber2019-07-311-279/+0
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated (many) references to renamed files found by that. llvm-svn: 367463
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* [sanitizer] optimize internal_memset for the most performance critical case ↵Kostya Serebryany2018-09-041-0/+12
| | | | | | (16-byte-aligned) llvm-svn: 341420
* [sanitizer] Use const char* in internal_simple_strtollVitaly Buka2018-06-171-1/+1
| | | | llvm-svn: 334900
* [sanitizer] Remove low-hanging-fruit dead codeKostya Kortchinsky2018-04-171-25/+0
| | | | | | | | | | | | | | | | | Summary: Going through the dead code findings, the code removed in this CL appears to be pretty straightforward to remove, and seems to be some leftover from previous refactors. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D45704 llvm-svn: 330190
* [compiler-rt] Add internal wcslen to avoid crashing on windows 64-bitsEtienne Bergeron2016-07-141-0/+6
| | | | | | | | | | | | | | | | | | Summary: The function wcslen is incorrectly hooked on windows 64-bits. The interception library is not able to hook without breaking the code. The function is too small and the interception must be done with trampoline-hooking which turned out to be incorrect on a small loop (first few instructions have a backedge). Reviewers: rnk Subscribers: wang0109, chrisha, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D22363 llvm-svn: 275488
* Fix warnings uncovered by building with clang-clReid Kleckner2016-04-011-1/+1
| | | | | | | Move ifdefs to avoid unused static helpers. Move alignment attribute so that it is respected in GCC and MSVC. llvm-svn: 265153
* [compiler-rt] Add internal implementations for strlcat and strlcpyAnna Zaks2015-11-201-0/+24
| | | | | | | | | | The compiler-rt should make use of strlcpy() rather than strncpy(). Using internal_strncpy() may be fine with appropriate bounds checking or enforcement of nul-termination elsewhere, but it's just good practice these days to avoid using strncpy() in new code. A patch by Jeremy Sequoia! Differential Revision: http://reviews.llvm.org/D14714 llvm-svn: 253690
* [compiler-rt] Fix build by wrapping lines to 80 chars (NFC)Vedant Kumar2015-10-011-1/+2
| | | | llvm-svn: 248973
* [sanitizer_common] Apply modernize-use-nullptr, other minor fixesVedant Kumar2015-09-301-10/+11
| | | | | | | | | | | | - Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13310 llvm-svn: 248964
* [compiler-rt] Make MaybeReexec properly process DYLD_INSERT_LIBRARIES when ↵Kuba Brecka2015-02-061-0/+9
| | | | | | | | | | | | using non-absolute paths MaybeReexec() in asan_mac.cc checks for presence of the ASan dylib in DYLD_INSERT_LIBRARIES, and if it is there, it will process this env. var. and remove the dylib from its value, so that spawned children don't have this variable set. However, the current implementation only works when using a canonical absolute path to the dylib, it fails to remove the dylib for example when using @executable_path. This patch changes the processing of DYLD_INSERT_LIBRARIES to comparing values only based on filenames (ignoring directories). Reviewed at http://reviews.llvm.org/D7160 llvm-svn: 228392
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-0/+8
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [ASan] Get fake stack code working with GCC 4.8.2.Jay Foad2014-11-211-11/+1
| | | | | | | | | | | | | | | | | | | | | Summary: TestCases/Linux/heavy_uar_test.cc was failing on my PowerPC64 box with GCC 4.8.2, because the compiler recognised a memset-like loop and turned it into a call to memset, which got intercepted by __asan_memset, which got upset because it was being called on an address in high shadow memory. Use break_optimization to stop the compiler from doing this. Reviewers: kcc, samsonov Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6266 llvm-svn: 222572
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-131-12/+12
| | | | llvm-svn: 221936
* tsan: fix windows buildDmitry Vyukov2014-02-041-1/+1
| | | | llvm-svn: 200778
* [ASan] Follow-up fix: use #if SANITIZER_WINDOWS, not #ifdefTimur Iskhodzhanov2013-11-251-1/+1
| | | | llvm-svn: 195625
* [ASan] Un-break the Windows buildTimur Iskhodzhanov2013-11-251-0/+5
| | | | llvm-svn: 195624
* [sanitizer] use 16-byte aligned bzero in performance critical place (mostly ↵Kostya Serebryany2013-11-231-0/+15
| | | | | | for lsan) llvm-svn: 195549
* Add internal_strchrnul functionAlexey Samsonov2013-09-031-0/+7
| | | | llvm-svn: 189797
* Avoid compiler-generated memset by using internal_memset.Will Dietz2013-08-301-2/+1
| | | | | | Fixes PR17025. llvm-svn: 189693
* Make InternalAlloc/InternalFree in sanitizer runtimes libc-free by switching ↵Alexey Samsonov2013-05-291-0/+1
| | | | | | to a custom allocator. llvm-svn: 182836
* asan/tsan: fix compilation errors/bugs on Windows where long is 32-bit even ↵Dmitry Vyukov2013-02-041-1/+1
| | | | | | in 64-bit mode llvm-svn: 174312
* [asan] implement more strict checking for memset/etc parameters. Instead of ↵Kostya Serebryany2012-12-281-0/+19
| | | | | | checking the first and the last byte, we check the entire shadow region. This costs ~10 slowdown for the instrumented functions. Motivated by a nasty memset-buffer-overflow-by-140-bytes in chrome which was reported as a use-after-free or not at all llvm-svn: 171198
* Fix a compiler warning in internal_memmove.Alexander Potapenko2012-10-261-5/+5
| | | | llvm-svn: 166775
* Fix the internal_memmove() implementation that used to skip src[0] if dst < src.Alexander Potapenko2012-10-261-2/+3
| | | | llvm-svn: 166774
* [asan] fix lintKostya Serebryany2012-10-161-1/+1
| | | | llvm-svn: 166006
* Implement internal_memmove.Alexander Potapenko2012-10-151-0/+16
| | | | | | | | Use internal_memmove() and internal_memcpy() in the memcpy() and memmove() wrappers when building the dynamic runtime (OS X only), to work around a bug in resolver functions wrapping. See also http://code.google.com/p/address-sanitizer/issues/detail?id=116 llvm-svn: 165939
* [Sanitizer] implement internal_strcspnAlexey Samsonov2012-08-211-0/+9
| | | | llvm-svn: 162272
* [tsan] a bit more lint and Makefile changes to run tests from sanitizer_commonKostya Serebryany2012-06-201-1/+1
| | | | llvm-svn: 158821
* [Sanitizer] add internal_strncmp to sanitizer libcAlexey Samsonov2012-06-181-0/+12
| | | | llvm-svn: 158658
* [Sanitizer] move all the rest re-implementations of libc functions from ASan ↵Alexey Samsonov2012-06-151-1/+60
| | | | | | runtime to common sanitizer runtime llvm-svn: 158519
* [Sanitizer] Use DEFINE_REAL macro in TSan runtime to call libc ↵Alexey Samsonov2012-06-151-0/+10
| | | | | | implementations of functions. Move strchr to sanitizer_libc. llvm-svn: 158517
* [Sanitizer] Move internal_memcmp to common sanitizer libcAlexey Samsonov2012-06-141-0/+9
| | | | llvm-svn: 158450
* [Sanitizer] add internal_memset and internal_strrchr to sanitizer_common/Alexey Samsonov2012-06-081-0/+20
| | | | llvm-svn: 158202
* [Sanitizer] move internal_strdup and internal_memcpy to common runtime. Make ↵Alexey Samsonov2012-06-071-1/+17
| | | | | | internal allocations from TSan runtime call InternalAlloc from common runtime llvm-svn: 158148
* [Sanitizer] Move more functions/constants to sanitizer_common.Alexey Samsonov2012-06-061-0/+6
| | | | llvm-svn: 158056
* [Sanitizer] rename sanitizer_defs.h to sanitizer_internal_defs.hAlexey Samsonov2012-06-051-1/+1
| | | | llvm-svn: 158001
* [Sanitizer] add sanitizer_posix.cc. Move more various functions into ↵Alexey Samsonov2012-06-051-0/+8
| | | | | | sanitizer_libc: sscanf, munmap, memchr llvm-svn: 157994
* Remove file-type tags in .cc files in tsan/ and sanitizer_common/Alexey Samsonov2012-06-041-1/+1
| | | | llvm-svn: 157928
* [Sanitizer]: move internal_strcmp to sanitizer_commonAlexey Samsonov2012-06-041-0/+12
| | | | llvm-svn: 157926
* [Sanitizer] Move internal_strncpy to sanitizer_libc (and make its behavior ↵Alexey Samsonov2012-06-041-0/+10
| | | | | | conforming to manual) llvm-svn: 157922
* [asan,tsan] rename files in sanitizer_common to have a common prefix ↵Kostya Serebryany2012-05-311-0/+20
(sanitizer_). llvm-svn: 157740
OpenPOWER on IntegriCloud