diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2013-12-16 03:20:06 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2013-12-16 03:20:06 +0000 |
| commit | ff1554738da8fed4bbb53fecab7f369d56a0cd66 (patch) | |
| tree | dbf64c110b8547c9286440ff99377c5571c18eae /lib/Basic/TargetInfo.cpp | |
| parent | 6cbd772cf9d6005a8d4e878713e8a38d52de3f20 (diff) | |
| download | clang-ff1554738da8fed4bbb53fecab7f369d56a0cd66.tar.gz clang-ff1554738da8fed4bbb53fecab7f369d56a0cd66.tar.bz2 clang-ff1554738da8fed4bbb53fecab7f369d56a0cd66.tar.xz | |
Stop crashing on empty asm input constraints
An empty string for an ASM input constraint is invalid, and will crash
during clang CodeGen. Change TargetInfo::validateInputConstraint to
reject an empty string.
<rdar://problem/15552191>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/TargetInfo.cpp')
| -rw-r--r-- | lib/Basic/TargetInfo.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 5aa84afc4d..d0ed6e6b16 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -482,6 +482,9 @@ bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints, ConstraintInfo &Info) const { const char *Name = Info.ConstraintStr.c_str(); + if (!*Name) + return false; + while (*Name) { switch (*Name) { default: |
