isl_tab_track_bmap: make sure we have a unique copy of the basic map
[platform/upstream/isl.git] / isl_tab.c
index 492be5c..8cb307e 100644 (file)
--- a/isl_tab.c
+++ b/isl_tab.c
@@ -3231,6 +3231,7 @@ error:
 
 int isl_tab_track_bmap(struct isl_tab *tab, __isl_take isl_basic_map *bmap)
 {
+       bmap = isl_basic_map_cow(bmap);
        if (!tab || !bmap)
                goto error;