From 5d0920446a62e522feb73c5402fa43f8a1feb2bb Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Fri, 3 Feb 2012 12:23:53 +0100 Subject: [PATCH] pet_scop_extract_from_C_source: return NULL in case of errors If the frontend detects one or more errors in the input, then scop_extract_from_C_source returns NULL instead of a possibly incomplete scop. Signed-off-by: Sven van Haastregt Signed-off-by: Sven Verdoolaege --- pet.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pet.cc b/pet.cc index a2cb198..72dc5b9 100644 --- a/pet.cc +++ b/pet.cc @@ -642,6 +642,10 @@ static struct pet_scop *scop_extract_from_C_source(isl_ctx *ctx, Diags.getClient()->EndSourceFile(); scop = consumer.scop; + if (Diags.hasErrorOccurred()) { + pet_scop_free(scop); + scop = NULL; + } if (scop) { scop->context = isl_set_intersect(context, scop->context); -- 2.11.4.GIT