DebugInfo: Fix use after return found by asan.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 24 Jan 2015 19:55:23 +0000 (19:55 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 24 Jan 2015 19:55:23 +0000 (19:55 +0000)
llvm-svn: 227012

llvm/include/llvm/IR/DebugInfo.h
llvm/lib/IR/DebugInfo.cpp

index 539025f..1aec146 100644 (file)
@@ -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.
index 9b5a9c3..88f7e33 100644 (file)
@@ -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);
 }