In isl_coalesce.c there is a comparison of a pointer to an integer. This is wrong.

14 views
Skip to first unread message

dc genunix

unread,
Apr 18, 2024, 7:06:16 PMApr 18
to isl Development

There seems to be no place to file a bug report.

So here :


$ diff -u ./isl_coalesce.c.orig ./isl_coalesce.c
--- ./isl_coalesce.c.orig       2021-04-11 09:43:14.000000000 +0000
+++ ./isl_coalesce.c    2024-04-18 21:47:57.689407719 +0000
@@ -3170,6 +3170,7 @@
                        return isl_stat_error;
                info->bmap = isl_basic_map_cow(info->bmap);
                info->bmap = isl_basic_map_free_inequality(info->bmap, 2 * n);
+               /* this is wrong. how can a pointer be less than integer zero? */
                if (info->bmap < 0)
                        return isl_stat_error;

You can not do this.

How can the pointer bmap ever be less than zero? That is impossible and makes no sense whatsoever.

 

Liviu Ionescu

unread,
Apr 19, 2024, 7:21:24 AMApr 19
to dc genunix, isl Development


> On 19 Apr 2024, at 00:53, dc genunix <arty....@gmail.com> wrote:
>
>
> ... You can not do this.
>
> How can the pointer bmap ever be less than zero? That is impossible and makes no sense whatsoever.

A build with `clang -Wall -Wextra` might help those who maintain this project to identify such issues.

Regards,

Liviu

Sven Verdoolaege

unread,
Apr 19, 2024, 2:05:49 PMApr 19
to dc genunix, isl Development
On Thu, Apr 18, 2024 at 02:53:44PM -0700, dc genunix wrote:
> $ diff -u ./isl_coalesce.c.orig ./isl_coalesce.c
> --- ./isl_coalesce.c.orig 2021-04-11 09:43:14.000000000 +0000
> +++ ./isl_coalesce.c 2024-04-18 21:47:57.689407719 +0000
> @@ -3170,6 +3170,7 @@
> return isl_stat_error;
> info->bmap = isl_basic_map_cow(info->bmap);
> info->bmap = isl_basic_map_free_inequality(info->bmap, 2 *
> n);
> + /* this is wrong. how can a pointer be less than integer
> zero? */
> if (info->bmap < 0)
> return isl_stat_error;

Thanks for the report, but this looks like an issue that was fixed in
isl-0.25-1-gf035f41be3 (isl_coalesce.c: tab_insert_divs: fix error handling,
Sun Aug 1 22:28:02 2021 +0200).

What version of isl are you using?

skimo
Reply all
Reply to author
Forward
0 new messages