forked from OSchip/llvm-project
[AMDGPU] Fix error handling in asm constraint syntax
I believe this is unexploitable because in either case the result will be 'couldn't allocate register for constraint' error message, but error code checking is clearly wrong. Differential Revision: https://reviews.llvm.org/D117189
This commit is contained in:
parent
67151d029b
commit
fc6af7e188
|
@ -11760,9 +11760,9 @@ SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI_,
|
|||
if (RegName.consume_front("[")) {
|
||||
uint32_t End;
|
||||
bool Failed = RegName.consumeInteger(10, Idx);
|
||||
Failed &= !RegName.consume_front(":");
|
||||
Failed &= RegName.consumeInteger(10, End);
|
||||
Failed &= !RegName.consume_back("]");
|
||||
Failed |= !RegName.consume_front(":");
|
||||
Failed |= RegName.consumeInteger(10, End);
|
||||
Failed |= !RegName.consume_back("]");
|
||||
if (!Failed) {
|
||||
uint32_t Width = (End - Idx + 1) * 32;
|
||||
MCRegister Reg = RC->getRegister(Idx);
|
||||
|
|
Loading…
Reference in New Issue