isl_*_list_add: do not modify lists in-place
commit72dd583bad9b19e913dc0fa868bad4ef9d70add7
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 25 Sep 2013 10:38:33 +0000 (25 12:38 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 18 Oct 2013 12:53:50 +0000 (18 14:53 +0200)
tree5e12f6b3f29606445b78a07ba32e71eaab68b8de
parent44355e8310315a48495db86fcffb8d900ee9292d
isl_*_list_add: do not modify lists in-place

isl_*_list_add calls isl_*_list_grow to ensure that there is room
for at least one more element and then directly modifies the
returned list.  If the original list was large enough already, then
isl_*_list_grow will simply return this list, even if there
is more than one reference to the list, resulting in
isl_*_list_add also modifying the other references to the original list.

We could just add a call to isl_*_list_cow in isl_*_list_add,
but that could result in the list getting copied twices.
Instead, we make sure that isl_*_list_grow always returns
a list with a single reference.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_list_templ.c