[LLVMbugs] [Bug 19009] New: Add warning to indicate when ARC implicit writeback occurs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 28 11:58:23 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=19009

            Bug ID: 19009
           Summary: Add warning to indicate when ARC implicit writeback
                    occurs
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tjw at me.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12171
  --> http://llvm.org/bugs/attachment.cgi?id=12171&action=edit
patch

Split out from http://llvm.org/bugs/show_bug.cgi?id=15649

In some cases, ARC implicit writeback can result in loss of what the user
likely intended. For example:

    int main(int argc, char *argv[])
    {
        __block id value = @"initial value";
        void (^block)(id *outValue) = ^(id *outValue){
            value = @"hello";
        };
        block(&value);
        NSLog(@"value = %@", value);
        return 0;
    }

With ARC, this reports:

    2013-04-24 13:55:35.814 block-local-address[28013:707] value = initial
value

but with MRR:

    2013-04-24 13:57:26.058 block-local-address[28046:707] value = hello

Attached is a patch vs trunk r202532 that adds -Warc-implicit-writeback and
test cases for the ObjC and ObjC++ compilers (which each seem to have their own
support for writeback).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140228/adab8c88/attachment.html>


More information about the llvm-bugs mailing list