https://bugs.llvm.org/show_bug.cgi?id=36381
rdar://37543426
Turns out, the type passed for the lambda capture was incorrect.
One more argument to abandon the getSVal overload which does not require the type information.
Differential D43925
[analyzer] Prevent crashing in NonNullParamChecker george.karpenkov on Feb 28 2018, 8:00 PM. Authored by
Details https://bugs.llvm.org/show_bug.cgi?id=36381 Turns out, the type passed for the lambda capture was incorrect.
Diff Detail Event TimelineComment Actions Here's the way i understand what's going on. @xazax.hun, you'd probably like this one because it's about lambdas. Though in fact, of course, it's about RegionStore - lambda support doesn't seem to be at fault.
The shocking part of this investigation is that for now even if region R is a typed-value region (FieldRegion in our case), specifying the optional type argument T in getSVal(R, T) is mandatory, otherwise the behavior may be completely incorrect. The current version of the patch tries to fix that. The underlying problem, however, remains: we should not be blindly returning a random binding on step 14, even if it's direct. And it is an open question for me whether performTrivialCopy should make a direct binding. Finally, i don't understand why everything else works and why this problem requires a super confusing reproducer with lambdas and heap allocations. |