usx95 wrote: > I have one question though. I sort of expected this to require a liveness > analysis. Is this something we will need down the line? Or is that not > required for polonius?
Good point. This is actually going to be a part of the error reporting. And yes, polonius does have a notion of live origins/loans. I can think of primarily two different strategies for generating diagnostics. 1. (preferred) Decide at the point where a **loan expires**: What are the origins that contain this expired loan and is still used later at some point. This would need a liveness analysis, i.e., it is an error to have a live origin which holds an expired loan. 2. Decide at the point where an **origin is used**: It is an error, if there is a use of an origin which holds an expired loan. The current dataflow results are enough to power this but we would need to remember which expired loans are already reported so that we do not error on each use of an origin holding an expired loan. I prefer approach 1 as this more directly works on the invalid memory as compared to origins carrying invalid loans to a potential use. I have left this out from the current implementation but let me know if you would found it helpful to implement a warning (maybe return-stack-addr) in this patch. https://github.com/llvm/llvm-project/pull/142313 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits