[PATCH] D47628: Detect an incompatible VLA pointer assignment

2018-06-05 Thread Jeremy Morse via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jmorse marked 2 inline comments as done. Closed by commit rL333989: Detect an incompatible VLA pointer assignment (authored by jmorse, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: http

[PATCH] D47628: Detect an incompatible VLA pointer assignment

2018-06-04 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D47628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D47628: Detect an incompatible VLA pointer assignment

2018-06-04 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse marked 2 inline comments as done. jmorse added inline comments. Comment at: lib/AST/ASTContext.cpp:8588 + Expr *E = VAT->getSizeExpr(); + if (E && VAT->getSizeExpr()->isIntegerConstantExpr(TheInt, *this)) +return std::make_pair(true, TheInt);

[PATCH] D47628: Detect an incompatible VLA pointer assignment

2018-06-04 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse updated this revision to Diff 149688. jmorse added a comment. Avoid un-necessary call, use APInt::isSameValue rather than operator!= https://reviews.llvm.org/D47628 Files: lib/AST/ASTContext.cpp test/Sema/vla.c Index: test/Sema/vla.c

[PATCH] D47628: Detect an incompatible VLA pointer assignment

2018-06-01 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: lib/AST/ASTContext.cpp:8588 + Expr *E = VAT->getSizeExpr(); + if (E && VAT->getSizeExpr()->isIntegerConstantExpr(TheInt, *this)) +return std::make_pair(true, TheInt); `E && E->isIntegerCons

[PATCH] D47628: Detect an incompatible VLA pointer assignment

2018-06-01 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse created this revision. jmorse added reviewers: eli.friedman, majnemer. Herald added a subscriber: cfe-commits. For pointer assignments of VLA types, Clang currently detects when array dimensions _lower_ than a variable dimension differ, and reports a warning. However it does not do the same