From 4181855d09c1b9f750f19b0afa293a05be73a514 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 20:24:31 +0000 Subject: [PATCH] Add test case with MISSING tag demonstrating instance-across-call shortcoming --- .../dataflow/typetracking/attribute_tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/ql/test/library-tests/dataflow/typetracking/attribute_tests.py b/python/ql/test/library-tests/dataflow/typetracking/attribute_tests.py index b6bca72507f..724be1091a4 100644 --- a/python/ql/test/library-tests/dataflow/typetracking/attribute_tests.py +++ b/python/ql/test/library-tests/dataflow/typetracking/attribute_tests.py @@ -161,6 +161,18 @@ print(instance.foo) # $ tracked MISSING: tracked=foo instance.print_foo() # $ MISSING: tracked=foo +# attribute set in method, but the instance flows across a call/return before the read. +# `instanceFieldStep` identifies the instance using only local flow from the constructor +# call, so a value stored on `self.foo` is not seen once the instance has crossed a +# function boundary. + +def make_my_class2(): + return MyClass2() + +returned_instance = make_my_class2() +print(returned_instance.foo) # $ MISSING: tracked + + # attribute set from outside of class class MyClass3(object):