diff options
| author | Mikhail R. Gadelha <mikhail.ramalho@gmail.com> | 2018-07-16 13:32:22 +0000 |
|---|---|---|
| committer | Mikhail R. Gadelha <mikhail.ramalho@gmail.com> | 2018-07-16 13:32:22 +0000 |
| commit | 07f6e8e3a5191ae8150ed7530d364326d78f000a (patch) | |
| tree | 89b04d78db56330a6349b612133b00715bf56a44 /llvm | |
| parent | 021e4c82eb600bdc9a55263aa6c0e8d93b7d7822 (diff) | |
| download | bcm5719-llvm-07f6e8e3a5191ae8150ed7530d364326d78f000a.tar.gz bcm5719-llvm-07f6e8e3a5191ae8150ed7530d364326d78f000a.zip | |
[analyzer] Fix the Z3 backend always generating unsigned APSInt
Summary:
In `toAPSInt`, the Z3 backend was not checking the variable `Int`'s type and was always generating unsigned `APSInt`s.
This was found by accident when I removed:
```
llvm::APSInt ConvertedLHS, ConvertedRHS;
QualType LTy, RTy;
std::tie(ConvertedLHS, LTy) = fixAPSInt(*LHS);
std::tie(ConvertedRHS, RTy) = fixAPSInt(*RHS);
- doIntTypePromotion<llvm::APSInt, Z3ConstraintManager::castAPSInt>(
- ConvertedLHS, LTy, ConvertedRHS, RTy);
return BVF.evalAPSInt(BSE->getOpcode(), ConvertedLHS, ConvertedRHS);
```
And the `BasicValueFactory` started to complain about different `signedness`.
Reviewers: george.karpenkov, NoQ, ddcc
Reviewed By: ddcc
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49305
llvm-svn: 337169
Diffstat (limited to 'llvm')
0 files changed, 0 insertions, 0 deletions

