- StaticData.push_back(CGF.EmitCheckTypeDescriptor(Info.E->getType())); + QualType ResTy = Info.E->getType(); + if (const CompoundAssignOperator *C = + dyn_cast<CompoundAssignOperator>(Info.E)) + ResTy = C->getComputationResultType(); + StaticData.push_back(CGF.EmitCheckTypeDescriptor(ResTy));
Could you just use Info.Ty here? Please add a test for Clang's test suite too. The tests in compiler-rt are intended to test compiler-rt itself (the formatting of the diagnostics, etc), not for testing that Clang produces correct data blocks (in particular, we should have sufficient coverage that we can refactor Clang's IRGen without running the compiler-rt tests). On Sun, Dec 30, 2012 at 12:13 AM, Will Dietz <[email protected]> wrote: > See attached patches, thanks! > > Description: > > When checking "a += b" we were using the type of 'a' in the > diagnostic, instead of the type of the overflowing expression "a+b". > This was particularly problematic when 'a' was signed and 'b' was > unsigned. > > Okay to commit? > > ~Will > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
