From b743f54d3eb7e7d76403e2893ffafc4a2070c083 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 29 May 2012 19:31:59 +0200 Subject: [PATCH] options.c: avoid calling isl_alloc_type without valid isl_ctx Although isl currently doesn't enforce the first argument to point to a valid isl_ctx object, it may do so in future. Signed-off-by: Sven Verdoolaege --- options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/options.c b/options.c index 392f817..9faa748 100644 --- a/options.c +++ b/options.c @@ -5,6 +5,7 @@ #include #include "config.h" +#define ALLOC(type) (type*)malloc(sizeof(type)) #define MAXRAYS (POL_NO_DUAL | POL_INTEGER) void barvinok_stats_clear(struct barvinok_stats *stats) @@ -100,7 +101,7 @@ ISL_ARGS_END static int stats_init(void *user) { struct barvinok_stats **stats = (struct barvinok_stats **)user; - *stats = isl_alloc_type(NULL, struct barvinok_stats); + *stats = ALLOC(struct barvinok_stats); if (*stats) barvinok_stats_clear(*stats); return *stats ? 0 : -1; -- 2.11.4.GIT