Page MenuHomePhabricator

emit constant expression for new expression array size if it is one
AcceptedPublic

Authored by nlewycky on Feb 13 2017, 3:24 PM.

Details

Summary

When the new expr's array size is an ICE, emit it as a constant expression.

This bypasses integer sanitization checks which are redundant on the expression since it's been checked by Sema. Fixes a clang codegen assertion on "void test() { new int[0+1]{0}; }" when building with -fsanitize=signed-integer-overflow.

Diff Detail

Event Timeline

nlewycky created this revision.Feb 13 2017, 3:24 PM
rsmith accepted this revision.Feb 13 2017, 3:42 PM
This revision is now accepted and ready to land.Feb 13 2017, 3:42 PM