================
@@ -469,11 +470,19 @@ void FactsGenerator::handleFullExprCleanup(
 }
 
 void FactsGenerator::handleExitBlock() {
----------------
usx95 wrote:

> Any assignment of stack memory to a global variable is treated as a potential 
> dangle. This was my initial approach, but @usx95 and I decided that this was 
> too strict.

The thing that Gábor mentions is different from the initial approach. It is 
less related to assignments themselves than how we model escapes associated 
with function calls. The call `save_global();` is key here and is responsible 
for the escape. 

The way we can do this is to associate a global escape to all function calls. 
This also generalises well for field escapes happening through member function 
calls (all member calls escape the pointer fields). In this model, EscapeFacts 
can be associated with some severity (strict and permissive) and we can 
diagnose accordingly.

That said, I think this belongs to a separate PR. 

https://github.com/llvm/llvm-project/pull/181646
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to