File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,11 @@ int32_t BinaryBasicBlock::getCFIStateAtInstr(const MCInst *Instr) const {
201
201
InstrSeen = (&Inst == Instr);
202
202
continue ;
203
203
}
204
- if (Function->getBinaryContext ().MIB ->isCFI (Inst)) {
204
+ // Fix: ignoring OpNegateRAState CFIs here, as they dont have a "State"
205
+ // number associated with them.
206
+ if (Function->getBinaryContext ().MIB ->isCFI (Inst) &&
207
+ (Function->getCFIFor (Inst)->getOperation () !=
208
+ MCCFIInstruction::OpNegateRAState)) {
205
209
LastCFI = &Inst;
206
210
break ;
207
211
}
Original file line number Diff line number Diff line change @@ -2596,6 +2596,7 @@ struct CFISnapshot {
2596
2596
void advanceTo (int32_t State) {
2597
2597
for (int32_t I = CurState, E = State; I != E; ++I) {
2598
2598
const MCCFIInstruction &Instr = FDE[I];
2599
+ assert (Instr.getOperation () != MCCFIInstruction::OpNegateRAState);
2599
2600
if (Instr.getOperation () != MCCFIInstruction::OpRestoreState) {
2600
2601
update (Instr, I);
2601
2602
continue ;
Original file line number Diff line number Diff line change @@ -632,8 +632,10 @@ bool CFIReaderWriter::fillCFIInfoFor(BinaryFunction &Function) const {
632
632
// DW_CFA_GNU_window_save and DW_CFA_GNU_NegateRAState just use the same
633
633
// id but mean different things. The latter is used in AArch64.
634
634
if (Function.getBinaryContext ().isAArch64 ()) {
635
- Function.addCFIInstruction (
636
- Offset, MCCFIInstruction::createNegateRAState (nullptr ));
635
+ // Fix: not adding OpNegateRAState since the location they are needed
636
+ // depends on the order of BasicBlocks, which changes during
637
+ // optimizations. They are generated in InsertNegateRAStatePass after
638
+ // optimizations instead.
637
639
break ;
638
640
}
639
641
if (opts::Verbosity >= 1 )
You can’t perform that action at this time.
0 commit comments