From d84e2e4d1d0cbe9d6b6f063faed1d2b0cb325280 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 24 Jan 2015 19:55:23 +0000 Subject: [PATCH] DebugInfo: Fix use after return found by asan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227012 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfo.h | 2 +- lib/IR/DebugInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index 539025f0df2..1aec146c579 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -886,7 +886,7 @@ public: /// \brief Returns underlying DIHeaderFieldIterator. const DIHeaderFieldIterator &getBase() const { return I; } /// \brief Returns the next operand. - const Operand &getNext() const; + Operand getNext() const; }; /// \brief An iterator for DIExpression elements. diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 9b5a9c3da47..88f7e33b7dc 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -170,7 +170,7 @@ DIExpression::iterator DIExpression::end() const { return DIExpression::iterator(); } -const DIExpression::Operand &DIExpression::Operand::getNext() const { +DIExpression::Operand DIExpression::Operand::getNext() const { iterator it(I); return *(++it); } -- 2.40.0