[PATCH] D27607: [ubsan] Treat ObjC's BOOL as if its range is always {0, 1}

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 9 12:32:25 PST 2016


ahatanak added inline comments.


================
Comment at: lib/CodeGen/CGExpr.cpp:1221
+/// Check if \p Ty is defined as BOOL in a system header. In ObjC language
+/// modes, it's safe to treat such a type as 'the builtin bool'.
+static bool isObjCBool(QualType Ty, const SourceManager &SM,
----------------
If your intention is to exclude BOOLs defined in files that aren't system headers, is it possible to add a test for that?


```
void foo() {
  typedef long long BOOL;
  ...
}
```


https://reviews.llvm.org/D27607





More information about the cfe-commits mailing list