[clang] [analyzer] Regularize conjured sym for return area of entrypoint (PR #244444)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 20 03:03:56 PST 2026
================
@@ -1239,3 +1240,32 @@ void test() {
}
} // namespace arguments_of_operators
#endif // __cplusplus >= 201103L
+
+namespace stack_frame_of_return_from_top {
+struct Obj {
+ int *p;
+ Obj() { p = new int; }
+ Obj(Obj &&s) : p(s.p) {
+ s.p = 0;
+ clang_analyzer_dump(this);
+ // expected-warning-re at -1 {{{{conj_\$[0-9]+{Obj \*, LC3, S[0-9]+, #[0-9]+}}}}}
+ }
+ ~Obj(); // Presumably releases 'p'.
+};
+
+Obj inner() {
+ // This is stack frame #3 (displayed as LC3 in the conjured symbol dump).
+ Obj o;
+ return o;
+}
+
+Obj middle() {
+ // This is stack frame #2 (would be displayed as LC2).
+ return inner();
+}
+
+Obj entrypoint() {
+ // This is stack frame #1 (would be displayed as LC1).
+ return middle();
+}
+} // namespace stack_frame_of_return_from_top
----------------
steakhal wrote:
```suggestion
} // namespace stack_frame_of_return_from_entrypoint
```
https://github.com/llvm/llvm-project/pull/244444
More information about the cfe-commits
mailing list