meikeb created this revision.
meikeb added a reviewer: rsmith.
meikeb added a subscriber: cfe-commits.
The warning for a format string not being a sting literal and therefore
being potentially insecure is overly strict for indecies into sting
literals. This fix checks if the index into the string
meikeb updated this revision to Diff 69057.
meikeb added a comment.
Fix typo.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
===
--- test/Sema/form
meikeb marked an inline comment as done.
Comment at: lib/Sema/SemaChecking.cpp:3856
@@ -3855,3 +3855,3 @@
// format string, we will usually need to emit a warning.
// True string literals are then checked by CheckFormatString.
static StringLiteralCheckType
I'm
meikeb added inline comments.
Comment at: lib/Sema/SemaChecking.cpp:4089-4090
@@ +4088,4 @@
+if (BinOp->isAdditiveOp()) {
+ bool LIsInt = BinOp->getLHS()->EvaluateAsInt(LResult, S.Context);
+ bool RIsInt = BinOp->getRHS()->EvaluateAsInt(RResult, S.Context);
+
---
meikeb updated this revision to Diff 71043.
meikeb added a comment.
Fix the mentioned issues.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
===
--
meikeb marked 4 inline comments as done.
Comment at: lib/Sema/SemaChecking.cpp:4166-4167
@@ +4165,4 @@
+if (BinOp->isAdditiveOp()) {
+ bool LIsInt = false;
+ bool RIsInt = false;
+ // Prevent asserts triggering in EvaluateAsInt by checking if we deal
with
-
meikeb updated this revision to Diff 71090.
meikeb marked an inline comment as done.
meikeb added a comment.
Fix mentioned issues.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
=
meikeb marked 6 inline comments as done.
meikeb added a comment.
Thanks for taking the time and doing these great reviews! Really appreciated!
Comment at: lib/Sema/SemaChecking.cpp:4143-4150
@@ -4049,3 +4142,10 @@
if (StrE) {
- CheckFormatString(S, StrE, E, Args, HasVA
meikeb updated this revision to Diff 71199.
meikeb marked 7 inline comments as done.
meikeb added a comment.
Fix typos and add assert to sum up offset helper.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
=
meikeb added a comment.
I explained why I chose the names that you commented on. Feel free to add your
thoughts if you still think another name would be more fitting.
Comment at: lib/Sema/SemaChecking.cpp:3842
@@ -3841,2 +3841,3 @@
-static void CheckFormatString(Sema &S, cons
meikeb updated this revision to Diff 71284.
meikeb added a comment.
Try to improve offset sum helper function name and fix style issues.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
===
meikeb marked 2 inline comments as done.
meikeb added a comment.
https://reviews.llvm.org/D23820
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
meikeb updated this revision to Diff 71286.
meikeb added a comment.
Correct assert position in offset sum helper function.
https://reviews.llvm.org/D23820
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
=
meikeb marked an inline comment as done.
Comment at: lib/Sema/SemaChecking.cpp:3864-3867
@@ +3863,6 @@
+ResOffset = Offset.sadd_ov(Addend, Ov);
+ else {
+assert(AddendIsRight && BinOpKind == BO_Sub &&
+ "operator must be add or sub with addend on the right");
+
meikeb marked an inline comment as done.
meikeb added a comment.
Thanks for reviewing my patch! It would be great if someone could submit this
patch for me.
https://reviews.llvm.org/D23820
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
meikeb created this revision.
meikeb added a reviewer: rsmith.
meikeb added subscribers: cfe-commits, srhines.
The warning for a format string not being a sting literal and therefore
being potentially insecure is overly strict for indecies into sting
literals. This fix checks if the index into the
meikeb added a comment.
This is the same as https://reviews.llvm.org/D23820 besides that I added myself
in the commit message as "Patch by". https://reviews.llvm.org/D23820 was
reverted in https://reviews.llvm.org/D24579 because srhines' commit took
authorship of this patch.
https://reviews.l
meikeb updated this revision to Diff 71438.
meikeb added a comment.
Fix typos in commit message.
https://reviews.llvm.org/D24584
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
===
meikeb updated this revision to Diff 71581.
meikeb added a comment.
Rebase to current commit.
https://reviews.llvm.org/D24584
Files:
lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGBlocks.h
lib/Sema/SemaChecking.cpp
test/CodeGenObjCXX/lambda-expressions.mm
test/Sema/format-strings.c
Index: te
meikeb updated this revision to Diff 71583.
meikeb added a comment.
Try to drop randomly uploaded commit.
https://reviews.llvm.org/D24584
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
==
meikeb updated this revision to Diff 71584.
meikeb added a comment.
Rebase
https://reviews.llvm.org/D24584
Files:
lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGBlocks.h
lib/Sema/SemaChecking.cpp
test/CodeGenObjCXX/lambda-expressions.mm
test/Sema/format-strings.c
Index: test/Sema/format-stri
meikeb updated this revision to Diff 71585.
meikeb added a comment.
.
https://reviews.llvm.org/D24584
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings.c
Index: test/Sema/format-strings.c
===
--- test/Sema/format-strin
22 matches
Mail list logo