[PATCH] Catch more cases when diagnosing integer-constant-expression overflows.

Josh Magee Joshua_Magee at playstation.sony.com
Tue Feb 3 16:01:21 PST 2015


Thanks for the review, Richard.  Here is a new patch that hopefully addresses your feedback.
I'm honestly a bit uncertain about how I'm handling the LHS of an assignment.  Evaluating it as an LValue makes sense because, as you pointed out, there may be overflow there.  However I don't see anything particularly useful that can be done with the result, particularly since I go on to set LHSOK to false.  That said, the code looks awkward enough that it feels like I could be overlooking something here.

I also added 2 lines to an existing complex test that would trigger this assertion if it is reached on assignment operator.  It's not terribly interesting, but it would have caught a mistake in the previous version of the patch at least.


http://reviews.llvm.org/D1238

Files:
  lib/AST/ExprConstant.cpp
  test/Sema/complex-int.c
  test/Sema/integer-overflow.c
  test/SemaCXX/integer-overflow.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1238.19280.patch
Type: text/x-patch
Size: 17016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150204/d0344677/attachment.bin>


More information about the cfe-commits mailing list