[commit: ghc] master: Revert "rts: Add an initial Coverity model" (7400810)

git at git.haskell.org git at git.haskell.org
Tue Apr 29 14:59:57 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7400810e3fb0af85da0cfb2b940bfe563687863f/ghc

>---------------------------------------------------------------

commit 7400810e3fb0af85da0cfb2b940bfe563687863f
Author: Austin Seipp <austin at well-typed.com>
Date:   Tue Apr 29 09:59:01 2014 -0500

    Revert "rts: Add an initial Coverity model"
    
    This reverts commit 4539400a72ded7fa69149b28cfa9c84464f4739d.


>---------------------------------------------------------------

7400810e3fb0af85da0cfb2b940bfe563687863f
 rts/Coverity.c |  112 --------------------------------------------------------
 1 file changed, 112 deletions(-)

diff --git a/rts/Coverity.c b/rts/Coverity.c
deleted file mode 100644
index d0a3708..0000000
--- a/rts/Coverity.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Coverity Scan model
- * This is a modeling file for Coverity Scan. Modeling helps to avoid false
- * positives.
- *
- * - A model file can't import any header files.  Some built-in primitives are
- *   available but not wchar_t, NULL etc.
- * - Modeling doesn't need full structs and typedefs. Rudimentary structs
- *   and similar types are sufficient.
- * - An uninitialized local variable signifies that the variable could be
- *   any value.
- *
- * The model file must be uploaded by an admin in the analysis settings of
- * http://scan.coverity.com/projects/1919
- */
-
-#define NULL ((void*)0)
-#define assert(x) if (!(x)) __coverity_panic__();
-
-/* type decls */
-typedef struct {} va_list;
-
-/* glibc functions */
-void *malloc (size_t);
-void *calloc (size_t, size_t);
-void *realloc (void *, size_t);
-void free (void *);
-
-/* rts allocation functions */
-
-void* stgMallocBytes(int n, char *msg)
-{
-  void *mem;
-  __coverity_negative_sink__((size_t)n);
-  mem = malloc((size_t)n);
-  assert(mem != NULL);
-  return mem;
-}
-
-void* stgReallocBytes(void *p, int n, char *msg)
-{
-  void *mem;
-  __coverity_negative_sink__((size_t)n);
-
-  /* man 3 realloc: if p == NULL, then realloc is equivalent to malloc() */
-  if (p == NULL) {
-    mem = malloc((size_t)n);
-    assert(mem != NULL);
-    return mem;
-  }
-
-  /* man 3 realloc: if n == 0, then realloc is equivalent to free() */
-  if (n == 0) {
-    free(p);
-    return NULL;
-  } else {
-    mem = realloc(p, (size_t)n);
-    assert(mem != NULL);
-    return mem;
-  }
-}
-
-void* stgCallocBytes(int n, int m, char *msg)
-{
-  void *mem;
-  __coverity_negative_sink__((size_t)n);
-  __coverity_negative_sink__((size_t)m);
-  mem = calloc(n, m);
-  assert(mem != NULL);
-  return mem;
-}
-
-void stgFree(void* p)
-{
-  free(p);
-}
-
-/* Kill paths */
-
-void stg_exit(int n)
-{
-  __coverity_panic__();
-}
-
-void shutdownThread(void)
-{
-  __coverity_panic__();
-}
-
-void shutdownHaskellAndExit(int exitCode, int fastExit)
-{
-  __coverity_panic__();
-}
-
-void shutdownHaskellAndSignal(int sig, int fastExit)
-{
-  __coverity_panic__();
-}
-
-void _assertFail(const char *filename, unsigned int linenum)
-{
-  __coverity_panic__();
-}
-
-void barf(const char *s, ...)
-{
-  __coverity_panic__();
-}
-
-void vbarf(const char *s, va_list ap)
-{
-  __coverity_panic__();
-}



More information about the ghc-commits mailing list