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 @@ -443,7 +443,7 @@ class PacRetAnalysis
443
443
public:
444
444
std::vector<MCInstReference>
445
445
getLastClobberingInsts (const MCInst &Inst, BinaryFunction &BF,
446
- const ArrayRef<MCPhysReg> UsedDirtyRegs) {
446
+ const ArrayRef<MCPhysReg> UsedDirtyRegs) const {
447
447
if (RegsToTrackInstsFor.empty ())
448
448
return {};
449
449
auto MaybeState = getStateBefore (Inst);
You can’t perform that action at this time.
0 commit comments