File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -292,14 +292,17 @@ class DataflowAnalysis {
292292 // / Relies on a ptr map to fetch the previous instruction and then retrieve
293293 // / state. WARNING: Watch out for invalidated pointers. Do not use this
294294 // / function if you invalidated pointers after the analysis has been completed
295- ErrorOr<const StateTy &> getStateBefore (const MCInst &Point) {
296- return getStateAt (PrevPoint[&Point]);
295+ ErrorOr<const StateTy &> getStateBefore (const MCInst &Point) const {
296+ auto It = PrevPoint.find (&Point);
297+ if (It == PrevPoint.end ())
298+ return make_error_code (std::errc::result_out_of_range);
299+ return getStateAt (It->getSecond ());
297300 }
298301
299- ErrorOr<const StateTy &> getStateBefore (ProgramPoint Point) {
302+ ErrorOr<const StateTy &> getStateBefore (ProgramPoint Point) const {
300303 if (Point.isBB ())
301304 return getStateAt (*Point.getBB ());
302- return getStateAt (PrevPoint[ Point.getInst ()] );
305+ return getStateBefore (* Point.getInst ());
303306 }
304307
305308 // / Remove any state annotations left by this analysis
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ class PacRetAnalysis
448448public:
449449 std::vector<MCInstReference>
450450 getLastClobberingInsts (const MCInst &Inst, BinaryFunction &BF,
451- const ArrayRef<MCPhysReg> UsedDirtyRegs) {
451+ const ArrayRef<MCPhysReg> UsedDirtyRegs) const {
452452 if (RegsToTrackInstsFor.empty ())
453453 return {};
454454 auto MaybeState = getStateBefore (Inst);
You can’t perform that action at this time.
0 commit comments