mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Tentative fix for global-buffer-overflow caused by r188426. Found by AddressSanitizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188448 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
07ad0c4c99
commit
84e51517e2
@ -115,7 +115,10 @@ const TargetRegisterClass *AMDGPUDAGToDAGISel::getOperandRegClass(SDNode *N,
|
||||
switch (N->getMachineOpcode()) {
|
||||
default: {
|
||||
const MCInstrDesc &Desc = TM.getInstrInfo()->get(N->getMachineOpcode());
|
||||
int RegClass = Desc.OpInfo[Desc.getNumDefs() + OpNo].RegClass;
|
||||
unsigned OpIdx = Desc.getNumDefs() + OpNo;
|
||||
if (OpIdx >= Desc.getNumOperands())
|
||||
return NULL;
|
||||
int RegClass = Desc.OpInfo[OpIdx].RegClass;
|
||||
if (RegClass == -1) {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user