This is an archive of the discontinued LLVM Phabricator instance.

libclang: Add APIs to check the result of an integer expression in CXEvalResult without overflow.
ClosedPublic

Authored by emilio on Nov 16 2016, 7:22 PM.

Details

Reviewers
akyrtzi
EricWF
Summary

It's really easy to overflow an int. This patch adds APIs to prevent that

Note that I chose this interface (as opposed to, let's say, add CXEval_UInt, for example), to keep working code working as much as possible.

Diff Detail

Repository
rL LLVM

Event Timeline

emilio updated this revision to Diff 78312.Nov 16 2016, 7:22 PM
emilio retitled this revision from to libclang: Add APIs to check the result of an integer expression in CXEvalResult without overflow..
emilio updated this object.
emilio added a reviewer: akyrtzi.
emilio set the repository for this revision to rL LLVM.
emilio added a project: Restricted Project.
akyrtzi accepted this revision.Dec 1 2016, 3:51 PM
akyrtzi edited edge metadata.

LGTM, thanks! Committed in r288438.

This revision is now accepted and ready to land.Dec 1 2016, 3:51 PM
akyrtzi closed this revision.Dec 1 2016, 3:52 PM