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
- rC Clang
- Build Status
Buildable 18793 Build 18793: arc lint + arc unit
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–1047 | What does L stand for here? It's confusing because L/R usually stand for left/right-hand-side in this context. | |
1156 | that's a separate change, but OK | |
1430 | It's redundant to mutate the argument passed by reference and also return it. | |
1641–1643 | 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–1047 | 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. | |
1156 | 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? | |
1430 | Sure. |
What does L stand for here? It's confusing because L/R usually stand for left/right-hand-side in this context.