================
@@ -2411,15 +2411,17 @@ SVal
RegionStoreManager::getBindingForVar(RegionBindingsConstRef B,
if (isa<StackArgumentsSpaceRegion>(MS))
return svalBuilder.getRegionValueSymbolVal(R);
- // Is 'VD' declared constant? If so, retrieve the constant value.
- if (VD->getType().isConstQualified()) {
+ // Is 'VD' declared constant, or is it a global function reference whose
+ // binding is necessarily immutable? If so, retrieve the value from its
+ // initializer.
+ if (VD->getType().isConstQualified() ||
+ (VD->hasGlobalStorage() && VD->getType()->isFunctionReferenceType())) {
----------------
steakhal wrote:
Why does it matter if its has global storage? - I guess those would work
already, right? But this makes it confusing.
https://github.com/llvm/llvm-project/pull/217608
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits