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_core.c
          +++ new/usr/src/cmd/sgs/libld/common/map_core.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   *      Copyright (c) 1988 AT&T
  24   24   *        All Rights Reserved
  25   25   *
  26   26   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       27 + *
       28 + * Copyright 2019 Joyent, Inc.
  27   29   */
  28   30  
  29   31  /*
  30   32   * Map file parsing (Shared Core Code).
  31   33   */
  32   34  #include        <fcntl.h>
  33   35  #include        <stdio.h>
  34   36  #include        <unistd.h>
  35   37  #include        <sys/stat.h>
  36   38  #include        <errno.h>
↓ open down ↓ 2029 lines elided ↑ open up ↑
2066 2068                                  goto tk_op_badchr;
2067 2069                          tok = (ch == '+') ? TK_PLUSEQ : TK_MINUSEQ;
2068 2070                          mf->mf_next += 2;
2069 2071                          return (tok);
2070 2072  
2071 2073                  default:        /* Non-OP token */
2072 2074                          mf->mf_next++;
2073 2075                          return (tok);
2074 2076                  }
2075 2077          }
2076      -
2077      -        /*NOTREACHED*/
2078      -        assert(0);
2079      -        return (TK_ERROR);
2080 2078  }
2081 2079  
2082 2080  /*
2083 2081   * Given a token and value returned by ld_map_gettoken(), return a string
2084 2082   * representation of it suitable for use in an error message.
2085 2083   *
2086 2084   * entry:
2087 2085   *      tok - Token code. Must not be an OP-token
2088 2086   *      tkv - Token value
2089 2087   */
↓ open down ↓ 752 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX