You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[infer][swift] demangle function-local class names in retain-cycle labels
Summary:
The retain-cycle message demangler (`Llair2TextualUtils.demangle_swift_class_name`)
bailed on classes declared local to a function: their mangled name carries a
local-discriminator suffix `L_C` instead of the plain `C` of a top-level class,
which wasn't in the nominal-instance whitelist, so the raw mangled string leaked
into the label.
Strip the leading `L<disc>` discriminator before the suffix check so a local
class renders its plain name. Flips the `rc_local_class_demangling` fixture from
`object of type class T5Hello...L_C` to `object of type class Node`.
Recovers the last literal name token only (`Node`); resolving the Swift mangling
substitution to the full `LocalNode`, and the nested `C0C` family, are follow-ups.
_Authored by Astro 🪐 (Claude Code agent)._
Reviewed By: davidpichardie
Differential Revision: D107674132
fbshipit-source-id: 33b060145c8b3a24a643388adff4143243114173
codetoanalyze/swift/pulse/rc_framework_url_session_overloads.swift, startBad, 1, RETAIN_CYCLE, no_bucket, ERROR, [assignment of self->task part of the trace starts here,parameter `self` of startBad,assigned,assignment of Swift closure part of the trace starts here,in call to `NSURLSession.downloadTaskWithURL:completionHandler:` (modelled),assigned,assignment of object of type class URLSessionDownloadTaskCycleHolder part of the trace starts here,variable `var6` accessed here,assigned,retain cycle here]
39
39
codetoanalyze/swift/pulse/rc_inline_concrete_delegate.swift, BarViewController.barView.get, 0, RETAIN_CYCLE, no_bucket, ERROR, [assignment of self->barView part of the trace starts here,parameter `self` of BarViewController.barView.get,assigned,assignment of self part of the trace starts here,when calling `Hello.BarViewController._3E5CC6EA0AF57922CE73F632956A8E47` here,in call to `BarView.init`,in call to `swift_allocObject` (modelled),return from call to `BarView.init`,assigned,retain cycle here]
40
40
codetoanalyze/swift/pulse/rc_intentional_self_retain.swift, fire_bad, 1, RETAIN_CYCLE, no_bucket, ERROR, [assignment of self->leakedSelf part of the trace starts here,parameter `self` of fire_bad,assigned,retain cycle here]
41
-
codetoanalyze/swift/pulse/rc_local_class_demangling.swift, wireBad, 1, RETAIN_CYCLE, no_bucket, ERROR, [assignment of object of type class T5Hello19makeLocalClassCycleyyF0C4NodeL_C part of the trace starts here,parameter `self` of wireBad,assigned,retain cycle here]
41
+
codetoanalyze/swift/pulse/rc_local_class_demangling.swift, wireBad, 1, RETAIN_CYCLE, no_bucket, ERROR, [assignment of object of type class Node part of the trace starts here,parameter `self` of wireBad,assigned,retain cycle here]
42
42
codetoanalyze/swift/pulse/rc_objc_inheritance.swift, configureCell_bad, 7, RETAIN_CYCLE, no_bucket, ERROR, [assignment of self->embedded part of the trace starts here,parameter `self` of configureCell_bad,assigned,assignment of createWidgetView().hostCell part of the trace starts here,in call to `createWidgetView`,in call to `init`,in call to `__objc_alloc_from_swift` (modelled),in call to `init`,parameter `var1` of init,in call to `NSObject.init` (modelled),returned,return from call to `init`,returned,return from call to `init`,returned,return from call to `createWidgetView`,when calling `WidgetDisplayView.setup` here,parameter `self` of WidgetDisplayView.setup,when calling `WidgetDisplayView.hostCell.set` here,parameter `self` of WidgetDisplayView.hostCell.set,assigned,retain cycle here]
43
43
codetoanalyze/swift/pulse/rc_unknown_value.swift, MainController.setup, 7, RETAIN_CYCLE, no_bucket, ERROR, [assignment of self part of the trace starts here,when calling `InnerWrapper.init` here,in call to `swift_allocObject` (modelled),when calling `init` here,parameter `self` of init,assigned,assignment of self->wrapper part of the trace starts here,parameter `self` of MainController.setup,assigned,retain cycle here]
44
44
codetoanalyze/swift/pulse/rc_unknown_value2.swift, test_retain_cycle_bad2, 12, RETAIN_CYCLE, no_bucket, ERROR, [assignment of object of type class State part of the trace starts here,in call to `swift_allocObject` (modelled),assigned,assignment of dynamically allocated object part of the trace starts here,when calling `DeviceAppManagerDelegateImpl.init` here,in call to `swift_allocObject` (modelled),when calling `init` here,parameter `self` of init,assigned,assignment of State.init().delegate->field_0 part of the trace starts here,in call to `State.init`,in call to `swift_allocObject` (modelled),return from call to `State.init`,assigned,retain cycle here]
0 commit comments