Skip to content

Commit 2368e28

Browse files
Vedant2005goyalvgvassilev
authored andcommitted
Fixes the valgrind fails which are caused because of pull_back operation in the VisitLambdaExpr done on list without checking whether it is empty or not
1 parent 8180ebe commit 2368e28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Differentiator/ReverseModeVisitor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,8 @@ Expr* ReverseModeVisitor::getStdInitListSizeExpr(const Expr* E) {
18511851

18521852
StmtDiff ReverseModeVisitor::VisitLambdaExpr(const LambdaExpr* LE) {
18531853
Expr* lambdaE = buildDerivedLambda(LE);
1854-
m_Pullback.pop_back();
1854+
if (!m_Pullback.empty())
1855+
m_Pullback.pop_back();
18551856
// FIXME: Clone lambda properly.
18561857
return {const_cast<Expr*>(cast<Expr>(LE)), lambdaE};
18571858
}

0 commit comments

Comments
 (0)