summaryrefslogtreecommitdiffstats
path: root/polly/lib/Exchange/JSONExporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Exchange/JSONExporter.cpp')
-rwxr-xr-xpolly/lib/Exchange/JSONExporter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index 72ecd3e4336..2653868ec1f 100755
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -272,17 +272,21 @@ bool JSONImporter::runOnScop(Scop &scop) {
if (!isl_map_has_equal_dim(currentAccessMap, newAccessMap)) {
errs() << "JScop file contains access function with incompatible "
<< "dimensions\n";
+ isl_map_free(newAccessMap);
return false;
}
if (isl_map_dim(newAccessMap, isl_dim_out) != 1) {
errs() << "New access map in JScop file should be single dimensional\n";
+ isl_map_free(newAccessMap);
return false;
}
if (!isl_map_is_equal(newAccessMap, currentAccessMap)) {
// Statistics.
++NewAccessMapFound;
- newAccessStrings.push_back(accesses.asCString());
+ newAccessStrings.push_back(accesses.asCString());
(*MI)->setNewAccessFunction(newAccessMap);
+ } else {
+ isl_map_free(newAccessMap);
}
memoryAccessIdx++;
}
OpenPOWER on IntegriCloud