aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorUtkarsh Saxena <usx@google.com>2025-08-18 13:46:43 +0200
committerGitHub <noreply@github.com>2025-08-18 13:46:43 +0200
commit673750feea3a5506ec7cc6271596856dcebe88c4 (patch)
treec7d9cfefa9b05ed41a425eaca9888c044cee2272 /flang/lib/Frontend/CompilerInvocation.cpp
parentc1e2a9c66db237c7603517866a492bcb9e3db9a9 (diff)
downloadllvm-673750feea3a5506ec7cc6271596856dcebe88c4.zip
llvm-673750feea3a5506ec7cc6271596856dcebe88c4.tar.gz
llvm-673750feea3a5506ec7cc6271596856dcebe88c4.tar.bz2
[LifetimeSafety] Implement a basic use-after-free diagnostic (#149731)
Implement use-after-free detection in the lifetime safety analysis with two warning levels. - Added a `LifetimeSafetyReporter` interface for reporting lifetime safety issues - Created two warning levels: - Definite errors (reported with `-Wexperimental-lifetime-safety-permissive`) - Potential errors (reported with `-Wexperimental-lifetime-safety-strict`) - Implemented a `LifetimeChecker` class that analyzes loan propagation and expired loans to detect use-after-free issues. - Added tracking of use sites through a new `UseFact` class. - Enhanced the `ExpireFact` to track the expressions where objects are destroyed. - Added test cases for both definite and potential use-after-free scenarios. The implementation now tracks pointer uses and can determine when a pointer is dereferenced after its loan has been expired, with appropriate diagnostics. The two warning levels provide flexibility - definite errors for high-confidence issues and potential errors for cases that depend on control flow.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions