mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1326289 - Fix BitWidth assertion failure in debug clang-plugin, r=ehsan
MozReview-Commit-ID: JNPc4CqEgPd
This commit is contained in:
parent
d622591233
commit
fb045a0ce3
@ -100,8 +100,12 @@ void OverrideBaseCallChecker::check(
|
||||
|
||||
// If list is not empty pop up errors
|
||||
for (auto BaseMethod : MethodsList) {
|
||||
std::string QualName;
|
||||
llvm::raw_string_ostream OS(QualName);
|
||||
BaseMethod->printQualifiedName(OS);
|
||||
|
||||
diag(Method->getLocation(), Error, DiagnosticIDs::Error)
|
||||
<< BaseMethod->getQualifiedNameAsString()
|
||||
<< OS.str()
|
||||
<< Decl->getName();
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,11 @@ void SprintfLiteralChecker::check(
|
||||
Literal = Result.Nodes.getNodeAs<IntegerLiteral>("constant");
|
||||
}
|
||||
|
||||
if (Type->getSize().ule(Literal->getValue())) {
|
||||
// We're going to assume here that the bitwidth of both of these values fits within 64 bits.
|
||||
// and zero-extend both values to 64-bits before comparing them.
|
||||
uint64_t Size = Type->getSize().getZExtValue();
|
||||
uint64_t Lit = Literal->getValue().getZExtValue();
|
||||
if (Size <= Lit) {
|
||||
diag(D->getLocStart(), Error, DiagnosticIDs::Error) << Name << Replacement;
|
||||
diag(D->getLocStart(), Note, DiagnosticIDs::Note) << Name;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user