Clang does not have a corresponding QualType for a 1-bit APSInt, so use the BoolTy and extend the APSInt. Split from D35450. Fixes PR37622.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Thanks! Looks good with minor changes.
Would it be possible to add tests? I know we have very few unit tests, but I assume you could actually use an integration test to exercise this path?
lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp | ||
---|---|---|
1044 ↗ | (On Diff #149344) | What does L stand for here? It's confusing because L/R usually stand for left/right-hand-side in this context. |
1154 ↗ | (On Diff #149344) | that's a separate change, but OK |
1426 ↗ | (On Diff #149344) | It's redundant to mutate the argument passed by reference and also return it. |
1640 ↗ | (On Diff #149344) | that's a separate change, but OK |
I tested this change and it fixes PR37622. There's a simple crash reproducer included there.
Cool, thanks for the repro! It's been long enough since I've touched this code that I don't recall the original failing testcase. I'll add the test to this revision.
lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp | ||
---|---|---|
1044 ↗ | (On Diff #149344) | They correspond to the inferred left/right hand-side inferred types, but inside the subsequent Z3Expr LHS and RHS variables. This is confusing, so I'll rename them to FromTy and ToTy. |
1154 ↗ | (On Diff #149344) | Yeah, this is one of several small miscellaneous changes that didn't make the original commit. It seemed a bit excessive to open separate revisions for each, so I've just been merging them into the next patch. I'm not sure which is preferable? |
1426 ↗ | (On Diff #149344) | Sure. |