Re: [PATCH] D24584: Do not warn about format strings that are indexed string literals.

2016-09-15 Thread Meike Baumgärtner via cfe-commits
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 === ---

Re: [PATCH] D24584: Do not warn about format strings that are indexed string literals.

2016-09-15 Thread Meike Baumgärtner via cfe-commits
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:

Re: [PATCH] D24584: Do not warn about format strings that are indexed string literals.

2016-09-15 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D24584: Do not warn about format strings that are indexed string literals.

2016-09-15 Thread Meike Baumgärtner via cfe-commits
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:

Re: [PATCH] D24584: Do not warn about format strings that are indexed string literals.

2016-09-14 Thread Meike Baumgärtner via cfe-commits
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.

[PATCH] D24584: Do not warn about format strings that are indexed string literals.

2016-09-14 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-14 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-13 Thread Meike Baumgärtner via cfe-commits
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"); +

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-13 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-13 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-13 Thread Meike Baumgärtner via cfe-commits
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 , const

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-13 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-12 Thread Meike Baumgärtner via cfe-commits
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,

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-12 Thread Meike Baumgärtner via cfe-commits
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

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-09-12 Thread Meike Baumgärtner via cfe-commits
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 ===

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-08-26 Thread Meike Baumgärtner via cfe-commits
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); +

Re: [PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-08-23 Thread Meike Baumgärtner via cfe-commits
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

[PATCH] D23820: Do not warn about format strings that are indexed string literals.

2016-08-23 Thread Meike Baumgärtner via cfe-commits
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