[svn:parrot] r40302 - trunk/compilers/imcc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Jul 28 08:17:17 UTC 2009


Author: chromatic
Date: Tue Jul 28 08:17:16 2009
New Revision: 40302
URL: https://trac.parrot.org/parrot/changeset/40302

Log:
[IMCC] Removed a NULL pointer check after a successful dereference of that
pointer.  If there's no code in the interpreter at the point of adding
annotations, something is far, far wronger than e_pbc_emit() can handle
(Coverity CID #410).

Modified:
   trunk/compilers/imcc/pbc.c

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Tue Jul 28 08:11:53 2009	(r40301)
+++ trunk/compilers/imcc/pbc.c	Tue Jul 28 08:17:16 2009	(r40302)
@@ -2231,7 +2231,7 @@
             /* Create segment. "_ANN" is added to the name */
             const               size_t len  = strlen(interp->code->base.name) + 5;
             char               * const name = (char *) mem_sys_allocate(len);
-            int                        add  = interp->code && interp->code->base.dir;
+            int                        add  = interp->code->base.dir ? 1 : 0;
             PackFile_Directory * const dir  = add ? interp->code->base.dir :
                     &interp->initial_pf->directory;
             strcpy(name, interp->code->base.name);


More information about the parrot-commits mailing list