[LLVMbugs] [Bug 16158] New: scan-build misses escapes of stack addresses

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 27 14:05:39 PDT 2013


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

            Bug ID: 16158
           Summary: scan-build misses escapes of stack addresses
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: rrh at newrelic.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10587
  --> http://llvm.org/bugs/attachment.cgi?id=10587&action=edit
shows an escape of the same variable, once to a global, the other to a location
in heap memory

scan-build does not complain about escapes (dangling references) of addresses
of automatic variables (eg, stack variables) when those escapes end up in heap
storage.  scan-build will, however, complain about dangling references held in
globals.

The attached program shows both kinds of escapes, and scan-build only complains
about one kind of escape:

test_escapes.c:14:27: warning: Address of stack memory associated with local
variable 'x' is still referred to by the global variable
'points_to_expired_frame' upon returning to the caller.  This will be a
dangling reference

-- 
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/20130527/06c88d29/attachment.html>


More information about the llvm-bugs mailing list