[PATCH] D65298: [DivRemPairs] Handling for expanded-form rem - recomposition (PR42673)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 04:43:33 PDT 2019


lebedev.ri planned changes to this revision.
lebedev.ri added a comment.

So yeah, that obviously doesn't work.

We do RAUW but we ignore the maps we created, so if one of the values we RAUW'd
happens to be dividend/divisor (and so is used as part of the key in those maps), we get UB.

While this patch exposed the issue, the same bug already exists in trunk: https://bugs.llvm.org/show_bug.cgi?id=42823

It is trivial to catch this via `PoisoningVH<>`/`AssertingVH<>`,
but the fix is not obvious - they are used as a key in a map,
so just using `TrackingVH`/`WeakTrackingVH` won't work.

There's `ValueMap`, but we use `DivRemMapKey` as key, not a single `Value`.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65298/new/

https://reviews.llvm.org/D65298





More information about the llvm-commits mailing list