зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1783374 - Adjust RefCountedInsideLambdaChecker to clang trunk changes. r=andi
`getCapturedVar()` now returns a `ValueDecl`.
(127bf44385
)
Differential Revision: https://phabricator.services.mozilla.com/D154046
This commit is contained in:
Родитель
4119f877a2
Коммит
b415d31f15
|
@ -90,7 +90,7 @@ void RefCountedInsideLambdaChecker::check(
|
|||
// "Smart Pointer" somehow?
|
||||
if (!StrongRefToThisCaptured && Capture.capturesVariable() &&
|
||||
Capture.getCaptureKind() == LCK_ByCopy) {
|
||||
const VarDecl *Var = Capture.getCapturedVar();
|
||||
const VarDecl *Var = dyn_cast<VarDecl>(Capture.getCapturedVar());
|
||||
if (Var->hasInit()) {
|
||||
const Stmt *Init = Var->getInit();
|
||||
|
||||
|
@ -119,7 +119,7 @@ void RefCountedInsideLambdaChecker::check(
|
|||
// pointers.
|
||||
for (const LambdaCapture &Capture : Lambda->captures()) {
|
||||
if (Capture.capturesVariable()) {
|
||||
const VarDecl *Var = Capture.getCapturedVar();
|
||||
const VarDecl *Var = dyn_cast<VarDecl>(Capture.getCapturedVar());
|
||||
QualType Pointee = Var->getType()->getPointeeType();
|
||||
if (!Pointee.isNull() && isClassRefCounted(Pointee) &&
|
||||
!IsKnownLive(Var)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче