[PATCH] D43928: [analyzer] Correctly measure array size in security.insecureAPI.strcpy

2018-05-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Sorry, i completely forgot about this one :( I think this patch needs `lit` tests, eg. tell the analyzer to analyze a simple strcpy() call on any `-target` with non-8-bit chars and see if it's still crashes or behaves incorrectly. Comment at: lib/StaticA

[PATCH] D43928: [analyzer] Correctly measure array size in security.insecureAPI.strcpy

2018-03-02 Thread András Leitereg via Phabricator via cfe-commits
leanil added inline comments. Comment at: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp:517 if (const auto *Array = dyn_cast(DeclRef->getType())) { - uint64_t ArraySize = BR.getContext().getTypeSize(Array) / 8; + auto ArraySize = BR.getContext().getTypeSi

[PATCH] D43928: [analyzer] Correctly measure array size in security.insecureAPI.strcpy

2018-03-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp:517 if (const auto *Array = dyn_cast(DeclRef->getType())) { - uint64_t ArraySize = BR.getContext().getTypeSize(Array) / 8; + auto ArraySize = BR.getContext().getTypeSizeI

[PATCH] D43928: [analyzer] Correctly measure array size in security.insecureAPI.strcpy

2018-03-01 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D43928 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D43928: [analyzer] Correctly measure array size in security.insecureAPI.strcpy

2018-03-01 Thread András Leitereg via Phabricator via cfe-commits
leanil updated this revision to Diff 136474. leanil added a comment. `getQuantity()` returns a signed type https://reviews.llvm.org/D43928 Files: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp Index: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp ==

[PATCH] D43928: [analyzer] Correctly measure array size in security.insecureAPI.strcpy

2018-03-01 Thread András Leitereg via Phabricator via cfe-commits
leanil created this revision. leanil added reviewers: dcoughlin, xazax.hun, NoQ. Herald added subscribers: a.sidorin, rnkovacs, szepet. Herald added a reviewer: george.karpenkov. This will handle those platforms that don't have 8-bit chars. This is a follow up fix to review https://reviews.llvm.or