diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2014-12-22 17:30:04 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2014-12-22 17:30:04 +0000 |
commit | 090d33e393284af774e05840448fc7349332b631 (patch) | |
tree | 6f5cfa54baa0d00e313c6a2641a8c73c4c4210dd /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7f9be7120d98a0fe030c0b54e000a97044bb76d2 (diff) | |
download | llvm-090d33e393284af774e05840448fc7349332b631.zip llvm-090d33e393284af774e05840448fc7349332b631.tar.gz llvm-090d33e393284af774e05840448fc7349332b631.tar.bz2 |
AddressSanitizer: Properly handle dispatch_source_set_cancel_handler with a
NULL handler
Per
https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html,
the dispatch_source_set_cancel_handler() API *can* be called with a NULL
handler. In that case, the libdispatch removes an already existing cancellation
handler, if there was one. ASan's interceptor always creates a new block that
always tries to call the original handler. In case the original block is NULL,
a segmentation fault happens. Let's fix that by not wrapping a NULL-block at
all.
It looks like all the other libdispatch APIs (which we intercept) do *not*
allow NULL. So it's really only the dispatch_source_set_cancel_handler one that
needs this fix.
Reviewed at http://reviews.llvm.org/D6747
llvm-svn: 224711
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions