This is an archive of the discontinued LLVM Phabricator instance.

[ConstantFold] Use getMinSignedBits for APInt in isIndexInRangeOfArrayType.
ClosedPublic

Authored by fhahn on Dec 10 2018, 5:31 PM.

Details

Summary

Indices for getelementptr can be signed so we should use
getMinSignedBits instead of getActiveBits here. The function later calls
getSExtValue to get the int64_t value, which also checks
getMinSignedBits.

This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11647.

Diff Detail

Event Timeline

fhahn created this revision.Dec 10 2018, 5:31 PM
This revision is now accepted and ready to land.Dec 11 2018, 11:42 AM
This revision was automatically updated to reflect the committed changes.