From bf845a4364f526aef8d7da1b9b75417c28009e73 Mon Sep 17 00:00:00 2001 From: Karthika Devi C Date: Wed, 14 Jan 2026 19:49:19 +0530 Subject: [PATCH] [Polly] Add null pointer check before size retrieval (#174309) This patch avoids assertion failures by ensuring a null pointer check is performed before accessing the object's size. Note: The corresponding test case remains too large even after reduction, so it has not been included in this patch. Fixes #174147 --- polly/lib/Analysis/ScopBuilder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp index 0f96c8923249..1ea9a554f761 100644 --- a/polly/lib/Analysis/ScopBuilder.cpp +++ b/polly/lib/Analysis/ScopBuilder.cpp @@ -3250,6 +3250,9 @@ static bool buildMinMaxAccess(isl::set Set, Set = Set.remove_divs(); polly::simplify(Set); + if (Set.is_null()) + return false; + if (unsignedFromIslSize(Set.n_basic_set()) > RunTimeChecksMaxAccessDisjuncts) Set = Set.simple_hull();