Memoization dose not seem to be necessary, as other statement visitors run just fine without it,
and in fact seems to be causing memory corruptions.
Just removing it instead of investigating the root cause.
rdar://45945002
Differential D54921
[analyzer] Remove memoization from RunLoopAutoreleaseLeakChecker george.karpenkov on Nov 26 2018, 3:11 PM. Authored by
Details Memoization dose not seem to be necessary, as other statement visitors run just fine without it, rdar://45945002
Diff Detail
Event TimelineComment Actions
I haven't reduced it, and it only runs under ASAN Comment Actions Hmm, i think i get it. Cached is a reference. Changing Memoization will invalidate references because DenseMap doesn't provide the respective guarantee. Here's how the code should have looked: ~ 77 Optional<TriBoolTy> Cached = Memoization[C]; ~ 78 if (!Cached) { 79 Cached = seenBeforeRec(C, A, B, Memoization); + 80 Memoization[C] = Cached; + 81 } Comment Actions @NoQ thanks, interesting! But I thought the underlying map is not actually modified while the reference is alive? Comment Actions I think that it is modified, at least, when Memoization[C] is evaluated. The object needs to be created and put into the map in order to obtain a reference to it. |