[PATCH] D90239: [MIR] Fix out of bounds access in MIRPrinter.

Daniil Fukalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 11:29:44 PDT 2020


dfukalov marked 4 inline comments as done.
dfukalov added inline comments.


================
Comment at: llvm/lib/CodeGen/MIRPrinter.cpp:91-92
   unsigned ID;
+  /// Index in StackObjects vector.
+  unsigned Idx;
   bool IsFixed;
----------------
arsenm wrote:
> Why does the index need to be stored? It seems like the problem is the printer/parser implicitly deleting dead objects
The issue was that IDs stored in `FrameIndexOperand` are not the same numbers as offsets in `YMF.StackObjects` and `YMF.FixedStackObjects` vectors, since they doesn't contain dead objects.

So I added mapping ID -> storage offset. They are stored in temporary `FixedStackObjectsIdx` and `StackObjectsIdx` within `MIRPrinter::convertStackObjects`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90239



More information about the llvm-commits mailing list