fjricci added a comment.
Awesome, good to know. Thanks!
Repository:
rL LLVM
https://reviews.llvm.org/D27607
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vsk added a comment.
In https://reviews.llvm.org/D27607#901882, @fjricci wrote:
> On platforms where `BOOL` == `signed char`, is it actually undefined behavior
> (or is it just bad programming practice) to store a value other than 0 or 1
> in your `BOOL`? I can't find any language specs suggest
fjricci added a comment.
On platforms where `BOOL` == `signed char`, is it actually undefined behavior
(or is it just bad programming practice) to store a value other than 0 or 1 in
your `BOOL`? I can't find any language specs suggesting that it is, and given
that it's just a typedef for a `sig
This revision was automatically updated to reflect the committed changes.
Closed by commit rL289290: [ubsan] Treat ObjC's BOOL as if its range is always
{0, 1} (authored by vedantk).
Changed prior to commit:
https://reviews.llvm.org/D27607?vs=80960&id=80969#toc
Repository:
rL LLVM
https://r
zaks.anna accepted this revision.
zaks.anna added a reviewer: zaks.anna.
zaks.anna added a comment.
This revision is now accepted and ready to land.
LGTM!
https://reviews.llvm.org/D27607
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http:/
vsk updated this revision to Diff 80960.
vsk marked 3 inline comments as done.
vsk added a comment.
- Use NSAPI's 'is-BOOL' predicate.
- Simplify test.
https://reviews.llvm.org/D27607
Files:
lib/CodeGen/CGExpr.cpp
test/CodeGenObjC/ubsan-bool.m
Index: test/CodeGenObjC/ubsan-bool.m
vsk marked 3 inline comments as done.
vsk added a comment.
Thanks for your feedback. I will updated the patch shortly.
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
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,
zaks.anna added inline comments.
Comment at: lib/CodeGen/CGExpr.cpp:1222
+/// modes, it's safe to treat such a type as 'the builtin bool'.
+static bool isObjCBool(QualType Ty, const SourceManager &SM,
+ const LangOptions &LO) {
Could you use
arphaman added inline comments.
Comment at: lib/CodeGen/CGExpr.cpp:1224
+ const LangOptions &LO) {
+ if (!LO.ObjC1 && !LO.ObjC2)
+return false;
LangOptions.ObjC1 should be always set if LangOptions.ObjC2 is set, so the
second check is
vsk created this revision.
vsk added a reviewer: ahatanak.
vsk added subscribers: kubabrecka, cfe-commits.
On some Apple platforms, the ObjC BOOL type is defined as a signed char.
When performing instrumentation for -fsanitize=bool, we'd like to treat
the range of BOOL like it's always {0, 1}. Whi
11 matches
Mail list logo