Make sure we increment the reference counter when passing out the isl_pw_aff
authorTobias Grosser <tobias@grosser.es>
Wed, 12 Aug 2015 15:45:41 +0000 (15:45 +0000)
committerTobias Grosser <tobias@grosser.es>
Wed, 12 Aug 2015 15:45:41 +0000 (15:45 +0000)
llvm-svn: 244758

polly/include/polly/ScopInfo.h

index ffc2b32..cad28be 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "llvm/ADT/MapVector.h"
 #include "llvm/Analysis/RegionPass.h"
+#include "isl/aff.h"
 #include "isl/ctx.h"
 
 #include <forward_list>
@@ -101,9 +102,9 @@ public:
   }
 
   /// @brief Return the size of dimension @p dim as isl_pw_aff.
-  const isl_pw_aff *getDimensionSizePw(unsigned dim) const {
+  __isl_give isl_pw_aff *getDimensionSizePw(unsigned dim) const {
     assert(dim < getNumberOfDimensions() && "Invalid dimension");
-    return DimensionSizesPw[dim - 1];
+    return isl_pw_aff_copy(DimensionSizesPw[dim - 1]);
   }
 
   /// @brief Get the type of the elements stored in this array.