microsoft / llvm-mctoll

llvm-mctoll
Other
816 stars 125 forks source link

Fix `getOperand() out of range!` for `getMCInstIndex` on `RETQ` instr #132

Closed martin-fink closed 3 years ago

martin-fink commented 3 years ago

This PR contains two commits:

The RETQ instruction has only a single explicit operand, so MI.getNumExplicitOperands() == MI.getNumOperands() == 1. The only operand is the metadata operand for this instruction, so we access the last operand.