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

           Summary: CSA still considers struct return values from messages
                    to nil as being garbage
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=7488)
 --> (http://llvm.org/bugs/attachment.cgi?id=7488)
Source file that reproduces the warning

Greg Parker has recently announced on Twitter that the Objective-C runtime now
zeroes out structs that are return values when a message is sent to nil:

https://twitter.com/#!/gparker/status/126504686583939072

‘With the LLVM Compiler and Xcode 4.2, struct-returning messages to nil now
return a zero-filled struct instead of an undefined struct value.’

However, CSA checker-258 still thinks that garbage is returned in this
situation:

‘The receiver of message 'xxx' is nil and returns a value of type 'yyy' that
will be garbage’

I’m attaching a sample program that reproduces this analyser warning as well as
the analyser output. I’m using stock Xcode 4.2 clang and CSA checker-258.

$ clang --version
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0
Thread model: posix

$ /usr/local/checker-258/scan-build
USAGE: scan-build [options] <build command> [build options]

ANALYZER BUILD: checker-258 (2011-10-13 20:54:07)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to