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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227012 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 539025f0df2c7347ecf96631342d9eedf2247733..1aec146c5792c7e82d33f02384e295cabf56da02 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 9b5a9c3da4723927f8f4b7724b567e38cb17df16..88f7e33b7dc1b302e2c360295d86b09873f65e47 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);
 }