swift
cdae12cc - ARCAnalysis: fix canNeverUseObject to correctly handle builtins.

Commit
6 years ago
ARCAnalysis: fix canNeverUseObject to correctly handle builtins. This analysis helper was inverting the result for builtins. Builtins such as "copyMemory" were treated as never using a value. This manifested in a crash in TestFoundation. NSDictionary's initializer released the incoming array before copying it. This crashed later during dictionary destruction. The crash was hidden by a secondary bug in mayHaveSymmetricInterference that effectively ignored the result from canNeverUseValue. Rename the helper to canUseObject, invert the result for builtins, and fix mayHaveSymmetricInterference to respect the result of canUseObject. Note that instructions that cannot access a referenced object obviously cannot not "interfere" with a release. Fixing these bugs now allows ARC optimization around dealloc_stack and other operations that don't care about the reference count.
Author
Committer
Parents
Loading