Fix crash with interrupt attribute on ARM.
An indirect call has no associated function declaration. llvm-svn: 297694
This commit is contained in:
parent
f978743907
commit
f5f1762ac6
|
@ -5387,7 +5387,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
|
|||
// but can be very challenging to debug.
|
||||
if (auto *Caller = getCurFunctionDecl())
|
||||
if (Caller->hasAttr<ARMInterruptAttr>())
|
||||
if (!FDecl->hasAttr<ARMInterruptAttr>())
|
||||
if (!FDecl || !FDecl->hasAttr<ARMInterruptAttr>())
|
||||
Diag(Fn->getExprLoc(), diag::warn_arm_interrupt_calling_convention);
|
||||
|
||||
// Promote the function operand.
|
||||
|
|
|
@ -28,3 +28,8 @@ __attribute__((interrupt("IRQ"))) void caller2() {
|
|||
callee1(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}}
|
||||
callee2();
|
||||
}
|
||||
|
||||
void (*callee3)();
|
||||
__attribute__((interrupt("IRQ"))) void caller3() {
|
||||
callee3(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue