Fix SEGV in InlineAsm::ConstraintInfo::Parse.
authorKarl Schimpf <kschimpf@google.com>
Thu, 3 Sep 2015 15:41:37 +0000 (15:41 +0000)
committerKarl Schimpf <kschimpf@google.com>
Thu, 3 Sep 2015 15:41:37 +0000 (15:41 +0000)
commit06bd94ca1b397e5a4bf7ebfa46ebd4b52d47f31a
tree37cdbe3852966e4c7af1798ef925b00e1b1f0fc6
parentc82ddc24fd38fcd2882a7b15f1e587d4ab4b4f6a
Fix SEGV in InlineAsm::ConstraintInfo::Parse.

Summary:
Fixes bug 24646. Previous code was not checking if an index into a vector
was valid, resulting in a SEGV. Fixed by assuming the construct can't
be parsed when given this input.

Reformat and add test.

Differential Revision: http://reviews.llvm.org/D12539

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246774 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/InlineAsm.cpp
test/Assembler/invalid-inline-constraint.ll [new file with mode: 0644]