[PATCH] D150816: [llvm-mca][RISCV] Fix llvm-mca RISCVInstrument memory leak

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 13:57:51 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/tools/llvm-mca/CodeRegion.cpp:140
   ActiveRegions[Description] = Regions.size();
   Regions.emplace_back(std::make_unique<InstrumentRegion>(Description, Loc, I));
 }
----------------
I is passed by reference to InstrumentRegion constructor. `I` is a local variable in this function. Doesn't it go out of scope when this function ends, leaving the reference in InstrumentRegion dangling?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150816



More information about the llvm-commits mailing list