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
ConstraintInfo &Info) const {
const char *Name = Info.ConstraintStr.c_str();
+ if (!*Name)
+ return false;
+
while (*Name) {
switch (*Name) {
default:
asm ("foo\n" : "=a" (i) : "[" (i)); // expected-error {{invalid input constraint '[' in asm}}
asm ("foo\n" : "=a" (i) : "[foo" (i)); // expected-error {{invalid input constraint '[foo' in asm}}
asm ("foo\n" : "=a" (i) : "[symbolic_name]" (i)); // expected-error {{invalid input constraint '[symbolic_name]' in asm}}
+
+ asm ("foo\n" : : "" (i)); // expected-error {{invalid input constraint '' in asm}}
+ asm ("foo\n" : "=a" (i) : "" (i)); // expected-error {{invalid input constraint '' in asm}}
}
void clobbers() {