зеркало из https://github.com/microsoft/clang.git
Fix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert when analyzing ICU.
Patch by Jean-Daniel Dupas. Thanks for spotting and fixing! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138757 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b1f2f47820
Коммит
5c96f862b7
|
@ -201,9 +201,11 @@ static SymbolRef getSymbolForRegion(CheckerContext &C,
|
|||
if (!isa<SymbolicRegion>(R)) {
|
||||
// Implicit casts (ex: void* -> char*) can turn Symbolic region into element
|
||||
// region, if that is the case, get the underlining region.
|
||||
if (const ElementRegion *ER = dyn_cast<ElementRegion>(R))
|
||||
if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
|
||||
R = ER->getAsArrayOffset().getRegion();
|
||||
else
|
||||
if (!isa<SymbolicRegion>(R))
|
||||
return 0;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
return cast<SymbolicRegion>(R)->getSymbol();
|
||||
|
|
|
@ -304,3 +304,9 @@ void DellocWithCFStringCreate4(CFAllocatorRef alloc) {
|
|||
CFRelease(userStr);
|
||||
}
|
||||
}
|
||||
|
||||
//Example from bug 10797.
|
||||
__inline__ static
|
||||
const char *__WBASLLevelString(int level) {
|
||||
return "foo";
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче