[all-commits] [llvm/llvm-project] 8c4a65: [ubsan] Check implicit casts in ObjC for-in statem...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Mon Jul 13 15:11:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c4a65b9b2ca6961139beca92de37eea479f00fa
      https://github.com/llvm/llvm-project/commit/8c4a65b9b2ca6961139beca92de37eea479f00fa
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-07-13 (Mon, 13 Jul 2020)

  Changed paths:
    M clang/docs/UndefinedBehaviorSanitizer.rst
    M clang/include/clang/Basic/Sanitizers.def
    M clang/lib/CodeGen/CGObjC.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/test/CodeGenObjC/for-in.m
    M compiler-rt/lib/ubsan/ubsan_checks.inc
    M compiler-rt/lib/ubsan/ubsan_handlers.cpp
    M compiler-rt/lib/ubsan/ubsan_handlers.h
    M compiler-rt/lib/ubsan/ubsan_value.cpp
    M compiler-rt/lib/ubsan/ubsan_value.h
    M compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
    A compiler-rt/test/ubsan/TestCases/Misc/objc-cast.m

  Log Message:
  -----------
  [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




More information about the All-commits mailing list