File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -292,14 +292,17 @@ class DataflowAnalysis {
292
292
// / Relies on a ptr map to fetch the previous instruction and then retrieve
293
293
// / state. WARNING: Watch out for invalidated pointers. Do not use this
294
294
// / 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 ());
297
300
}
298
301
299
- ErrorOr<const StateTy &> getStateBefore (ProgramPoint Point ) {
302
+ ErrorOr<const StateTy &> getStateBefore (ProgramPoint Point ) const {
300
303
if (Point .isBB ())
301
304
return getStateAt (*Point .getBB ());
302
- return getStateAt (PrevPoint[ Point .getInst ()] );
305
+ return getStateBefore (* Point .getInst ());
303
306
}
304
307
305
308
// / Remove any state annotations left by this analysis
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ class PacRetAnalysis
448
448
public:
449
449
std::vector<MCInstReference>
450
450
getLastClobberingInsts (const MCInst &Inst, BinaryFunction &BF,
451
- const ArrayRef<MCPhysReg> UsedDirtyRegs) {
451
+ const ArrayRef<MCPhysReg> UsedDirtyRegs) const {
452
452
if (RegsToTrackInstsFor.empty ())
453
453
return {};
454
454
auto MaybeState = getStateBefore (Inst);
You can’t perform that action at this time.
0 commit comments