Skip to content
  1. Feb 18, 2009
  2. Feb 17, 2009
  3. Feb 16, 2009
  4. Feb 14, 2009
    • Ted Kremenek's avatar
      GRExprEngine: Handle empty statement expressions. · d25fb7a6
      Ted Kremenek authored
      llvm-svn: 64541
      d25fb7a6
    • Ted Kremenek's avatar
      Added GRStateManager::scanReachableSymbols(), a method which scans the reachable · 4e9d4b5d
      Ted Kremenek authored
      symbols from an SVal.
      
      - Fixed a bug in EnvironmentManager::RemoveDeadBindings() where it did not mark
        live all the symbols reachable from a live block-level expression.
      
      - Fixed a bug in the retain/release checker where it did not stop tracking
        symbols that 'escaped' via compound literals being assigned to something the
        BasicStoreManager didn't reason about.
      
      llvm-svn: 64534
      4e9d4b5d
    • Douglas Gregor's avatar
      Extend builtin "attribute" syntax to include a notation for · ac5d4c5f
      Douglas Gregor authored
      printf-like functions, both builtin functions and those in the
      C library. The function-call checker now queries this attribute do
      determine if we have a printf-like function, rather than scanning
      through the list of "known functions IDs". However, there are 5
      functions they are not yet "builtins", so the function-call checker
      handles them specifically still:
      
        - fprintf and vfprintf: the builtins mechanism cannot (yet)
          express FILE* arguments, so these can't be encoded.
        - NSLog: the builtins mechanism cannot (yet) express NSString*
          arguments, so this (and NSLogv) can't be encoded.
        - asprintf and vasprintf: these aren't part of the C99 standard
          library, so we really shouldn't be defining them as builtins in
          the general case (and we don't seem to have the machinery to make
          them builtins only on certain targets and depending on whether
          extensions are enabled).
      
      llvm-svn: 64512
      ac5d4c5f
    • Douglas Gregor's avatar
      Implicitly declare certain C library functions (malloc, strcpy, memmove, · b9063fc1
      Douglas Gregor authored
      etc.) when we perform name lookup on them. This ensures that we
      produce the correct signature for these functions, which has two
      practical impacts:
      
        1) When we're supporting the "implicit function declaration" feature
        of C99, these functions will be implicitly declared with the right
        signature rather than as a function returning "int" with no
        prototype. See PR3541 for the reason why this is important (hint:
        GCC always predeclares these functions).
       
        2) If users attempt to redeclare one of these library functions with
        an incompatible signature, we produce a hard error.
      
      This patch does a little bit of work to give reasonable error
      messages. For example, when we hit case #1 we complain that we're
      implicitly declaring this function with a specific signature, and then
      we give a note that asks the user to include the appropriate header
      (e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
      case #2, we show the type of the implicit builtin that was incorrectly
      declared, so the user can see the problem. We could do better here:
      for example, when displaying this latter error message we say
      something like:
      
        'strcpy' was implicitly declared here with type 'char *(char *, char
        const *)'
      
      but we should really print out a fake code line showing the
      declaration, like this:
      
        'strcpy' was implicitly declared here as:
      
          char *strcpy(char *, char const *)
      
      This would also be good for printing built-in candidates with C++
      operator overloading.
      
      The set of C library functions supported by this patch includes all
      functions from the C99 specification's <stdlib.h> and <string.h> that
      (a) are predefined by GCC and (b) have signatures that could cause
      codegen issues if they are treated as functions with no prototype
      returning and int. Future work could extend this set of functions to
      other C library functions that we know about.
      
      llvm-svn: 64504
      b9063fc1
  5. Feb 13, 2009
  6. Feb 11, 2009
  7. Feb 09, 2009
  8. Feb 08, 2009
  9. Feb 07, 2009
  10. Feb 06, 2009
  11. Feb 05, 2009
    • Ted Kremenek's avatar
      Add 'AppendValue' to the list of magic CF function names that cause a tracked... · 0ca23d3f
      Ted Kremenek authored
      Add 'AppendValue' to the list of magic CF function names that cause a tracked object to escape.  Fixes <rdar://problem/6560661>.
      
      llvm-svn: 63891
      0ca23d3f
    • Ted Kremenek's avatar
      Overhaul BugReporter interface and implementation. The new interface cleans up · fc5d067e
      Ted Kremenek authored
      the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes,
      and BugTypes are owned by the BugReporter object.
      
      The major functionality change in this patch is that reports are not immediately
      emitted by a call to BugReporter::EmitWarning (now called EmitReport), but
      instead of queued up in report "equivalence classes". When
      BugReporter::FlushReports() is called, it emits one diagnostic per report
      equivalence class. This provides a nice cleanup with the caching of reports as
      well as enables the BugReporter engine to select the "best" path for reporting a
      path-sensitive bug based on all the locations in the ExplodedGraph that the same
      bug could occur.
      
      Along with this patch, Leaks are now coalesced into a common equivalence class
      by their allocation site, and the "summary" diagnostic for leaks now reports the
      allocation site as the location of the bug (this may later be augmented to also
      provide an example location where the leak occurs).
      
      llvm-svn: 63796
      fc5d067e
  12. Jan 30, 2009
    • Ted Kremenek's avatar
      Fix horrible non-termination bug in LiveVariables. The issue was that · 378e7fd3
      Ted Kremenek authored
      the liveness state of block-level expressions could oscillate because
      of two issues:
      - The initial value before a merge was not always set to "Top"
      - The set of live block-level expressions is a union, not an intersection
      
      This fixes <rdar://problem/650084>.
      
      llvm-svn: 63421
      378e7fd3
    • Nuno Lopes's avatar
      fix RUN line · 8247c9a3
      Nuno Lopes authored
      llvm-svn: 63392
      8247c9a3
    • Nuno Lopes's avatar
      enable test as it works · c3a558fd
      Nuno Lopes authored
      llvm-svn: 63391
      c3a558fd
    • Ted Kremenek's avatar
      Fix a couple bugs: · 7594e2a5
      Ted Kremenek authored
      - NonLoc::MakeVal() would use sizeof(unsigned) (literally) instead of consulting
        ASTContext for the size (in bits) of 'int'. While it worked, it was a
        conflation of concepts and using ASTContext.IntTy is 100% correct.
      - RegionStore::getSizeInElements() no longer assumes that a VarRegion has the
        type "ConstantArray", and handles the case when uses use ordinary variables
        as if they were arrays.
      - Fixed ElementRegion::getRValueType() to just return the rvalue type of its
        "array region" in the case the array didn't have ArrayType.
      - All of this fixes <rdar://problem/6541136>
      
      llvm-svn: 63347
      7594e2a5
  13. Jan 29, 2009
  14. Jan 28, 2009
  15. Jan 27, 2009
  16. Jan 24, 2009
  17. Jan 23, 2009
  18. Jan 22, 2009
Loading