From 4d140907a0923fc9ec076a68f37a1e7a27d67a34 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 13 Jan 2019 15:40:58 +0100 Subject: [PATCH] skip functions without valid scops when autodetecting When autodetecting, PetScan::scan will return a NULL pointer when it cannot find a valid scop in a given function. This NULL pointer gets passed to call_fn, resulting in an error being raised and no further functions being considered, without any feedback to the user (since autodetection turn off diagnostics). This is especially problematic when an unanalyzable function appears in an included header. Simply ignore functions without a valid scop and move on to the next function (if any). Reported-by: Daniel Maier Signed-off-by: Sven Verdoolaege --- pet.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pet.cc b/pet.cc index 011ee83..46e3ed9 100644 --- a/pet.cc +++ b/pet.cc @@ -709,6 +709,8 @@ struct PetASTConsumer : public ASTConsumer { isl_union_map_copy(vb), independent); scop = ps.scan(fd); + if (!scop) + continue; call_fn(scop); continue; } -- 2.11.4.GIT