projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07ad0c4
)
Tentative fix for global-buffer-overflow caused by r188426. Found by AddressSanitizer
author
Alexey Samsonov
<samsonov@google.com>
Thu, 15 Aug 2013 07:11:34 +0000
(07:11 +0000)
committer
Alexey Samsonov
<samsonov@google.com>
Thu, 15 Aug 2013 07:11:34 +0000
(07:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188448
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Target/R600/AMDGPUISelDAGToDAG.cpp
patch
|
blob
|
history
diff --git
a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
index 22bdb90cca09e118e25be5973115b3d3e79281cb..77ca8856018f6c04b125619a236075908157ff39 100644
(file)
--- a/
lib/Target/R600/AMDGPUISelDAGToDAG.cpp
+++ b/
lib/Target/R600/AMDGPUISelDAGToDAG.cpp
@@
-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;
}