Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/map_support.c
          +++ new/usr/src/cmd/sgs/libld/common/map_support.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21  
  22   22  /*
  23   23   *      Copyright (c) 1988 AT&T
  24   24   *        All Rights Reserved
  25   25   *
  26   26   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  
  30   30  /*
  31      - * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       31 + * Copyright 2019 Joyent, Inc.
  32   32   */
  33   33  
  34   34  /*
  35   35   * Map file parsing (Shared Support Code).
  36   36   */
  37   37  #include        <stdio.h>
  38   38  #include        <errno.h>
  39   39  #include        "msg.h"
  40   40  #include        "_libld.h"
  41   41  #include        "_map.h"
↓ open down ↓ 35 lines elided ↑ open up ↑
  77   77                      (name_offset + (const char *) array));
  78   78  
  79   79                  if (arr_name == NULL)
  80   80                          return (NULL);
  81   81  
  82   82                  if (strcasecmp(name, arr_name) == 0)
  83   83                          return (array);
  84   84          }
  85   85  
  86   86          /*NOTREACHED*/
  87      -        assert(0);
  88      -        return (NULL);
  89   87  }
  90   88  #endif
  91   89  
  92   90  /*
  93   91   * Given the same NULL terminated array accepted by ld_map_kwfind(), format
  94   92   * the strings into a comma separated list of names.
  95   93   *
  96   94   * entry:
  97   95   *      array - Base address of array
  98   96   *      name_offset - Offset of the name field within the struct
↓ open down ↓ 93 lines elided ↑ open up ↑
 192  190   * objects.
 193  191   */
 194  192  void
 195  193  ld_map_cap_set_ovflag(Mapfile *mf, Word type)
 196  194  {
 197  195          /*
 198  196           * Map capability tag to the corresponding output descriptor
 199  197           * override flag.
 200  198           */
 201  199          static ofl_flag_t override_flag[CA_SUNW_NUM] = {
 202      -                0,                      /* CA_SUNW_NULL */
      200 +                0,                      /* CA_SUNW_NULL */
 203  201                  FLG_OF1_OVHWCAP1,       /* CA_SUNW_HW_1 */
 204  202                  FLG_OF1_OVSFCAP1,       /* CA_SUNW_SF_1 */
 205  203                  FLG_OF1_OVHWCAP2,       /* CA_SUNW_HW_2 */
 206  204                  FLG_OF1_OVPLATCAP,      /* CA_SUNW_PLAT */
 207  205                  FLG_OF1_OVMACHCAP,      /* CA_SUNW_MACH */
 208  206                  FLG_OF1_OVIDCAP         /* CA_SUNW_ID */
 209  207          };
 210  208  #if CA_SUNW_NUM != (CA_SUNW_ID + 1)
 211  209  #error "CA_SUNW_NUM has grown"
 212  210  #endif
↓ open down ↓ 1279 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX