mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
[WebKit checkers] Treat asm brk as trivial (#155046)
Like other functions which results in abort, treat asm brk instruction as trivial.
This commit is contained in:
@@ -666,6 +666,10 @@ public:
|
||||
return IsFunctionTrivial(Callee);
|
||||
}
|
||||
|
||||
bool VisitGCCAsmStmt(const GCCAsmStmt *AS) {
|
||||
return AS->getAsmString() == "brk #0xc471";
|
||||
}
|
||||
|
||||
bool
|
||||
VisitSubstNonTypeTemplateParmExpr(const SubstNonTypeTemplateParmExpr *E) {
|
||||
// Non-type template paramter is compile time constant and trivial.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// RUN: %clang_analyze_cc1 -triple arm-darwin -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
void crash()
|
||||
{
|
||||
__asm__ volatile ("brk #0xc471");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
class SomeObj {
|
||||
public:
|
||||
void ref();
|
||||
void deref();
|
||||
|
||||
void someWork() { crash(); }
|
||||
};
|
||||
|
||||
SomeObj* provide();
|
||||
|
||||
void doSomeWork() {
|
||||
provide()->someWork();
|
||||
}
|
||||
Reference in New Issue
Block a user