Skip to content

Commit 036021c

Browse files
authored
Prevent taking a reference to a nullptr in frontend (#29048)
Adjusts some frontend compiler code to avoid potential nullptr dereferencing and subsequent taking a reference to a nullptr. [Reviewed by @benharsh]
2 parents c69a781 + 600e362 commit 036021c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/include/chpl/resolution/ResolutionContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ class ResolutionContext {
269269
}
270270
template <typename T>
271271
bool canUseGlobalCacheConsidering(const T* t) const {
272-
return canUseGlobalCacheConsidering(*t);
272+
if (!isUnstable()) return true;
273+
return ResolutionContext::canUseGlobalCache(context_, t);
273274
}
274275
template <typename... Ts>
275276
bool canUseGlobalCacheConsidering(const std::tuple<Ts...>& ts) {

0 commit comments

Comments
 (0)