| Issue |
63878
|
| Summary |
Debug build clang encounter assertion fail for inline asm with wrong input.
|
| Labels |
clang:frontend,
crash
|
| Assignees |
|
| Reporter |
yetingk
|
Release build clang sends error message `impossible constraint in asm: can't store value into a register`.
```
void foo() {
extern int arr[];
asm ("" : "=r" (arr));
}
```
But debug build clang encounters assertion fails for `IntegerType::get()` with Size=0. since `int[]` is incomplete, so `ASTContext::getTypeSize()` returns 0 for it.
```
// CodeGenFunction::EmitAsmStmt in CGStmt.cpp.
if (RequiresCast) {
unsigned Size = getContext().getTypeSize(QTy);
Ty = llvm::IntegerType::get(getLLVMContext(), Size);
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs