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
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
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);
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
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
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