Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at scanner.c:984

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

df_lex

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dfilter/scanner.c)expand/collapse
Show more  
 830  YY_DECL 
 831  {
 832          register yy_state_type yy_current_state;
 833          register char *yy_cp, *yy_bp;
 834          register int yy_act;
 835       
 836  #line 82 "scanner.l"
 837   
 838   
 839  #line 840 "scanner.c"
 840   
 841          if ( !(yy_init) )
 842                  {
 843                  (yy_init) = 1;
 844   
 845  #ifdef YY_USER_INIT 
 846                  YY_USER_INIT;
 847  #endif
 848   
 849                  if ( ! (yy_start) )
 850                          (yy_start) = 1; /* first start state */
 851   
 852                  if ( ! df_in )
 853                          df_in = stdin;
 854   
 855                  if ( ! df_out )
 856                          df_out = stdout;
 857   
 858                  if ( ! YY_CURRENT_BUFFER ) {
 859                          df_ensure_buffer_stack ();
 860                          YY_CURRENT_BUFFER_LVALUE =
 861                                  df__create_buffer(df_in,YY_BUF_SIZE );
 862                  }
 863   
 864                  df__load_buffer_state( );
 865                  }
 866   
 867          while ( 1 )             /* loops until end-of-file is reached */
 868                  {
 869                  yy_cp = (yy_c_buf_p);
 870   
 871                  /* Support of df_text. */
 872                  *yy_cp = (yy_hold_char);
 873   
 874                  /* yy_bp points to the position in yy_ch_buf of the start of 
 875                   * the current run.
 876                   */
 877                  yy_bp = yy_cp;
 878   
 879                  yy_current_state = (yy_start);
 880  yy_match:
 881                  do 
 882                          {
 883                          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 884                          if ( yy_accept[yy_current_state] )
 885                                  {
 886                                  (yy_last_accepting_state) = yy_current_state;
 887                                  (yy_last_accepting_cpos) = yy_cp;
 888                                  }
 889                          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 890                                  {
 891                                  yy_current_state = (int) yy_def[yy_current_state];
 892                                  if ( yy_current_state >= 111 )
 893                                          yy_c = yy_meta[(unsigned int) yy_c];
 894                                  }
 895                          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 896                          ++yy_cp;
 897                          }
 898                  while ( yy_current_state != 110 );
 899                  yy_cp = (yy_last_accepting_cpos);
 900                  yy_current_state = (yy_last_accepting_state);
 901   
 902  yy_find_action:
 903                  yy_act = yy_accept[yy_current_state];
 904   
 905                  YY_DO_BEFORE_ACTION;
 906   
 907  do_action:      /* This label is used only to access EOF actions. */
 908   
 909                  switch ( yy_act )
 910          { /* beginning of action switch */
 911                          case 0: /* must back up */
 912                          /* undo the effects of YY_DO_BEFORE_ACTION */
 913                          *yy_cp = (yy_hold_char);
 914                          yy_cp = (yy_last_accepting_cpos);
 915                          yy_current_state = (yy_last_accepting_state);
 916                          goto yy_find_action;
 917   
 918  case 1:
 919  /* rule 1 can match eol */
 920  YY_RULE_SETUP 
 921  #line 84 "scanner.l"
 922  /* ignore whitespace */
 923          YY_BREAK 
 924  case 2:
 925  YY_RULE_SETUP 
 926  #line 88 "scanner.l"
 927  return simple(TOKEN_LPAREN);
 928          YY_BREAK 
 929  case 3:
 930  YY_RULE_SETUP 
 931  #line 89 "scanner.l"
 932  return simple(TOKEN_RPAREN);
 933          YY_BREAK 
 934  case 4:
 935  YY_RULE_SETUP 
 936  #line 90 "scanner.l"
 937  return simple(TOKEN_COMMA);
 938          YY_BREAK 
 939  case 5:
 940  YY_RULE_SETUP 
 941  #line 92 "scanner.l"
 942  return simple(TOKEN_TEST_EQ);
 943          YY_BREAK 
 944  case 6:
 945  YY_RULE_SETUP 
 946  #line 93 "scanner.l"
 947  return simple(TOKEN_TEST_EQ);
 948          YY_BREAK 
 949  case 7:
 950  YY_RULE_SETUP 
 951  #line 94 "scanner.l"
 952  {
 953          mark_lval_deprecated("!=");
 954          return simple(TOKEN_TEST_NE);
 955  }
 956          YY_BREAK 
 957  case 8:
 958  YY_RULE_SETUP 
 959  #line 98 "scanner.l"
 960  {
 961          mark_lval_deprecated("ne");
 962          return simple(TOKEN_TEST_NE);
 963  }
 964          YY_BREAK 
 965  case 9:
 966  YY_RULE_SETUP 
 967  #line 102 "scanner.l"
 968  return simple(TOKEN_TEST_GT);
 969          YY_BREAK 
 970  case 10:
 971  YY_RULE_SETUP 
 972  #line 103 "scanner.l"
 973  return simple(TOKEN_TEST_GT);
 974          YY_BREAK 
 975  case 11:
 976  YY_RULE_SETUP 
 977  #line 104 "scanner.l"
 978  return simple(TOKEN_TEST_GE);
 979          YY_BREAK 
 980  case 12:
 981  YY_RULE_SETUP 
 982  #line 105 "scanner.l"
 983  return simple(TOKEN_TEST_GE);
 984          YY_BREAK 
 985  case 13:
 986  YY_RULE_SETUP 
 987  #line 106 "scanner.l"
 988  return simple(TOKEN_TEST_LT);
 989          YY_BREAK 
 990  case 14:
 991  YY_RULE_SETUP 
 992  #line 107 "scanner.l"
 993  return simple(TOKEN_TEST_LT);
 994          YY_BREAK 
 995  case 15:
 996  YY_RULE_SETUP 
 997  #line 108 "scanner.l"
 998  return simple(TOKEN_TEST_LE);
 999          YY_BREAK 
 1000  case 16:
 1001  YY_RULE_SETUP 
 1002  #line 109 "scanner.l"
 1003  return simple(TOKEN_TEST_LE);
 1004          YY_BREAK 
 1005  case 17:
 1006  YY_RULE_SETUP 
 1007  #line 110 "scanner.l"
 1008  return simple(TOKEN_TEST_BITWISE_AND);
 1009          YY_BREAK 
 1010  case 18:
 1011  YY_RULE_SETUP 
 1012  #line 111 "scanner.l"
 1013  return simple(TOKEN_TEST_BITWISE_AND);
 1014          YY_BREAK 
 1015  case 19:
 1016  YY_RULE_SETUP 
 1017  #line 112 "scanner.l"
 1018  return simple(TOKEN_TEST_CONTAINS);
 1019          YY_BREAK 
 1020  case 20:
 1021  YY_RULE_SETUP 
 1022  #line 113 "scanner.l"
 1023  return simple(TOKEN_TEST_MATCHES);
 1024          YY_BREAK 
 1025  case 21:
 1026  YY_RULE_SETUP 
 1027  #line 114 "scanner.l"
 1028  return simple(TOKEN_TEST_MATCHES);
 1029          YY_BREAK 
 1030  case 22:
 1031  YY_RULE_SETUP 
 1032  #line 115 "scanner.l"
 1033  return simple(TOKEN_TEST_NOT);
 1034          YY_BREAK 
 1035  case 23:
 1036  YY_RULE_SETUP 
 1037  #line 116 "scanner.l"
 1038  return simple(TOKEN_TEST_NOT);
 1039          YY_BREAK 
 1040  case 24:
 1041  YY_RULE_SETUP 
 1042  #line 117 "scanner.l"
 1043  return simple(TOKEN_TEST_AND);
 1044          YY_BREAK 
 1045  case 25:
 1046  YY_RULE_SETUP 
 1047  #line 118 "scanner.l"
 1048  return simple(TOKEN_TEST_AND);
 1049          YY_BREAK 
 1050  case 26:
 1051  YY_RULE_SETUP 
 1052  #line 119 "scanner.l"
 1053  return simple(TOKEN_TEST_OR);
 1054          YY_BREAK 
 1055  case 27:
 1056  YY_RULE_SETUP 
 1057  #line 120 "scanner.l"
 1058  return simple(TOKEN_TEST_OR);
 1059          YY_BREAK 
 1060  case 28:
 1061  YY_RULE_SETUP 
 1062  #line 123 "scanner.l"
 1063  {
 1064          BEGIN(RANGE_INT);
 1065          return simple(TOKEN_LBRACKET);
 1066  }
 1067          YY_BREAK 
 1068  case 29:
 1069  YY_RULE_SETUP 
 1070  #line 128 "scanner.l"
 1071  {
 1072          BEGIN(RANGE_PUNCT);
 1073          return set_lval_int(TOKEN_INTEGER, df_text);
 1074  }
 1075          YY_BREAK 
 1076  case 30:
 1077  YY_RULE_SETUP 
 1078  #line 133 "scanner.l"
 1079  {
 1080          BEGIN(RANGE_PUNCT);
 1081          return set_lval_int(TOKEN_INTEGER, df_text);
 1082  }
 1083          YY_BREAK 
 1084  case 31:
 1085  YY_RULE_SETUP 
 1086  #line 138 "scanner.l"
 1087  {
 1088          BEGIN(RANGE_INT);
 1089          return simple(TOKEN_COLON);
 1090  }
 1091          YY_BREAK 
 1092  case 32:
 1093  YY_RULE_SETUP 
 1094  #line 143 "scanner.l"
 1095  {
 1096          BEGIN(RANGE_INT);
 1097          return simple(TOKEN_HYPHEN);
 1098  }
 1099          YY_BREAK 
 1100  case 33:
 1101  YY_RULE_SETUP 
 1102  #line 148 "scanner.l"
 1103  {
 1104          BEGIN(RANGE_INT);
 1105          return simple(TOKEN_COMMA);
 1106  }
 1107          YY_BREAK 
 1108  case 34:
 1109  YY_RULE_SETUP 
 1110  #line 153 "scanner.l"
 1111  {
 1112          BEGIN(INITIAL);
 1113          return simple(TOKEN_RBRACKET);
 1114  }
 1115          YY_BREAK 
 1116  /* Error if none of the above while scanning a range (slice) */
 1117  case 35:
 1118  /* rule 35 can match eol */
 1119  YY_RULE_SETUP 
 1120  #line 160 "scanner.l"
 1121  {
 1122          dfilter_fail("Invalid string \"%s\" found while scanning slice.", df_text);
 1123          return SCAN_FAILED;
 1124  }
 1125          YY_BREAK 
 1126  /* XXX It would be nice to be able to match an entire non-integer string,
 1127           * but beware of Flex's "match the most text" rule.
 1128           */
 1129  case 36:
 1130  YY_RULE_SETUP 
 1131  #line 169 "scanner.l"
 1132  {
 1133          dfilter_fail("Invalid character \"%s\" found while scanning slice; expected integer.", df_text);
 1134          return SCAN_FAILED;
 1135  }
 1136          YY_BREAK 
 1137  case 37:
 1138  YY_RULE_SETUP 
 1139  #line 174 "scanner.l"
 1140  {
 1141          /* start quote */
 1142          /* The example of how to scan for strings was taken from 
 1143          the flex 2.5.4 manual, from the section "Start Conditions".
 1144          See:
 1145          http://www.gnu.org/software/flex/manual/html_node/flex_11.html */
 1146   
 1147          BEGIN(DQUOTE);
 1148          /* A previous filter that failed to compile due to 
 1149          a missing end quote will have left quoted_string set 
 1150          to something. Clear it now that we are starting 
 1151          a new quoted string. */
 1152          if (quoted_string) {
 1153                  g_string_free(quoted_string, TRUE);
 1154                  /* Don't set quoted_string to NULL, as we
 1155                  do in other quoted_string-cleanup code, as we're
 1156                  about to set it in the next line. */
 1157          }
 1158          quoted_string = g_string_new("");
 1159  }
 1160          YY_BREAK 
 1161  case YY_STATE_EOF(DQUOTE):
 1162  #line 195 "scanner.l"
 1163  {
 1164          /* unterminated string */
 1165          /* The example of how to handle unclosed strings was taken from 
 1166          the flex 2.5.4 manual, from the section "End-of-file rules".
 1167          See:
 1168          http://www.gnu.org/software/flex/manual/html_node/flex_13.html */
 1169   
 1170          dfilter_fail("The final quote was missing from a quoted string.");
 1171          return SCAN_FAILED;
 1172  }
 1173          YY_BREAK 
 1174  case 38:
 1175  YY_RULE_SETUP 
 1176  #line 206 "scanner.l"
 1177  {
 1178          /* end quote */
 1179          int token;
 1180          BEGIN(INITIAL);
 1181          token = set_lval(TOKEN_STRING, quoted_string->str);
 1182          g_string_free(quoted_string, TRUE);
 1183          quoted_string = NULL;
 1184          return token;
 1185  }
 1186          YY_BREAK 
 1187  case 39:
 1188  YY_RULE_SETUP 
 1189  #line 216 "scanner.l"
 1190  {
 1191          /* octal sequence */
 1192          unsigned int result;
 1193          sscanf(df_text + 1, "%o", &result);
 1194          if (result > 0xff) {
 1195                  g_string_free(quoted_string, TRUE);
 1196                  quoted_string = NULL;
 1197                  dfilter_fail("%s is larger than 255.", df_text);
 1198                  return SCAN_FAILED;
 1199          }
 1200          g_string_append_c(quoted_string, (gchar) result);
 1201  }
 1202          YY_BREAK 
 1203  case 40:
 1204  YY_RULE_SETUP 
 1205  #line 229 "scanner.l"
 1206  {
 1207          /* hex sequence */
 1208          unsigned int result;
 1209          sscanf(df_text + 2, "%x", &result);
 1210          g_string_append_c(quoted_string, (gchar) result);
 1211  }
 1212          YY_BREAK 
 1213  case 41:
 1214  YY_RULE_SETUP 
 1215  #line 237 "scanner.l"
 1216  {
 1217          /* escaped character */
 1218          g_string_append_c(quoted_string, df_text[1]);
 1219  }
 1220          YY_BREAK 
 1221  case 42:
 1222  /* rule 42 can match eol */
 1223  YY_RULE_SETUP 
 1224  #line 242 "scanner.l"
 1225  {
 1226          /* non-escaped string */
 1227          g_string_append(quoted_string, df_text);
 1228  }
 1229          YY_BREAK 
 1230  case 43:
 1231  YY_RULE_SETUP 
 1232  #line 249 "scanner.l"
 1233  {
 1234          /* CIDR */
 1235          return set_lval(TOKEN_UNPARSED, df_text);
 1236  }
 1237          YY_BREAK 
 1238  case 44:
 1239  YY_RULE_SETUP 
 1240  #line 254 "scanner.l"
 1241  {
 1242          /* Is it a field name? */
 1243          header_field_info *hfinfo;
 1244      df_func_def_t *df_func_def;
 1245   
 1246          hfinfo = proto_registrar_get_byname(df_text);
 1247          if (hfinfo) {
 1248                  /* Yes, it's a field name */
 1249                  return set_lval(TOKEN_FIELD, hfinfo);
 1250          }
 1251          else {
 1252          /* Is it a function name? */
 1253          df_func_def = df_func_lookup(df_text);
 1254          if (df_func_def) {
 1255              /* yes, it's a dfilter function */
 1256              return set_lval(TOKEN_FUNCTION, df_func_def);
 1257          }
 1258          else {
 1259              /* No, so treat it as an unparsed string */
 1260              return set_lval(TOKEN_UNPARSED, df_text);
 1261          }
 1262          }
 1263  }
 1264          YY_BREAK 
 1265  case 45:
 1266  YY_RULE_SETUP 
 1267  #line 278 "scanner.l"
 1268  {
 1269          /* Default */
 1270          return set_lval(TOKEN_UNPARSED, df_text);
 1271  }
 1272          YY_BREAK 
 1273  case 46:
 1274  YY_RULE_SETUP 
 1275  #line 284 "scanner.l"
 1276  ECHO;
 1277          YY_BREAK 
 1278  #line 1279 "scanner.c"
 1279  case YY_STATE_EOF(INITIAL):
 1280  case YY_STATE_EOF(RANGE_INT):
 1281  case YY_STATE_EOF(RANGE_PUNCT):
 1282          yyterminate();
 1283   
 1284          case YY_END_OF_BUFFER:
 1285                  {
 1286                  /* Amount of text matched not including the EOB char. */
 1287                  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 1288   
 1289                  /* Undo the effects of YY_DO_BEFORE_ACTION. */
 1290                  *yy_cp = (yy_hold_char);
 1291                  YY_RESTORE_YY_MORE_OFFSET 
 1292   
 1293                  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 1294                          {
 1295                          /* We're scanning a new file or input source.  It's
 1296                           * possible that this happened because the user 
 1297                           * just pointed df_in at a new source and called 
 1298                           * df_lex().  If so, then we have to assure 
 1299                           * consistency between YY_CURRENT_BUFFER and our 
 1300                           * globals.  Here is the right place to do so, because 
 1301                           * this is the first action (other than possibly a 
 1302                           * back-up) that will match for the new input source.
 1303                           */
 1304                          (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 1305                          YY_CURRENT_BUFFER_LVALUE->yy_input_file = df_in;
 1306                          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 1307                          }
 1308   
 1309                  /* Note that here we test for yy_c_buf_p "<=" to the position 
 1310                   * of the first EOB in the buffer, since yy_c_buf_p will 
 1311                   * already have been incremented past the NUL character
 1312                   * (since all states make transitions on EOB to the
 1313                   * end-of-buffer state).  Contrast this with the test
 1314                   * in input().
 1315                   */
 1316                  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 1317                          { /* This was really a NUL. */
 1318                          yy_state_type yy_next_state;
 1319   
 1320                          (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 1321   
 1322                          yy_current_state = yy_get_previous_state(  );
 1323   
 1324                          /* Okay, we're now positioned to make the NUL
 1325                           * transition.  We couldn't have 
 1326                           * yy_get_previous_state() go ahead and do it 
 1327                           * for us because it doesn't know how to deal
 1328                           * with the possibility of jamming (and we don't
 1329                           * want to build jamming into it because then it 
 1330                           * will run more slowly).
 1331                           */
 1332   
 1333                          yy_next_state = yy_try_NUL_trans( yy_current_state );
 1334   
 1335                          yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1336   
 1337                          if ( yy_next_state )
 1338                                  {
 1339                                  /* Consume the NUL. */
 1340                                  yy_cp = ++(yy_c_buf_p);
 1341                                  yy_current_state = yy_next_state;
 1342                                  goto yy_match;
 1343                                  }
 1344   
 1345                          else 
 1346                                  {
 1347                                  yy_cp = (yy_last_accepting_cpos);
 1348                                  yy_current_state = (yy_last_accepting_state);
 1349                                  goto yy_find_action;
 1350                                  }
 1351                          }
 1352   
 1353                  else switch ( yy_get_next_buffer(  ) )
 1354                          {
 1355                          case EOB_ACT_END_OF_FILE:
 1356                                  {
 1357                                  (yy_did_buffer_switch_on_eof) = 0;
 1358   
 1359                                  if ( df_wrap( ) )
 1360                                          {
 1361                                          /* Note: because we've taken care in 
 1362                                           * yy_get_next_buffer() to have set up
 1363                                           * df_text, we can now set up 
 1364                                           * yy_c_buf_p so that if some total
 1365                                           * hoser (like flex itself) wants to
 1366                                           * call the scanner after we return the 
 1367                                           * YY_NULL, it'll still work - another 
 1368                                           * YY_NULL will get returned.
 1369                                           */
 1370                                          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 1371   
 1372                                          yy_act = YY_STATE_EOF(YY_START);
 1373                                          goto do_action;
 1374                                          }
 1375   
 1376                                  else 
 1377                                          {
 1378                                          if ( ! (yy_did_buffer_switch_on_eof) )
 1379                                                  YY_NEW_FILE;
 1380                                          }
 1381                                  break;
 1382                                  }
 1383   
 1384                          case EOB_ACT_CONTINUE_SCAN:
 1385                                  (yy_c_buf_p) =
 1386                                          (yytext_ptr) + yy_amount_of_matched_text;
 1387   
 1388                                  yy_current_state = yy_get_previous_state(  );
 1389   
 1390                                  yy_cp = (yy_c_buf_p);
 1391                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1392                                  goto yy_match;
 1393   
 1394                          case EOB_ACT_LAST_MATCH:
 1395                                  (yy_c_buf_p) =
 1396                                  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 1397   
 1398                                  yy_current_state = yy_get_previous_state(  );
 1399   
 1400                                  yy_cp = (yy_c_buf_p);
 1401                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1402                                  goto yy_find_action;
 1403                          }
 1404                  break;
 1405                  }
 1406   
 1407          default:
 1408                  YY_FATAL_ERROR(
 1409                          "fatal flex scanner internal error--no action found" );
 1410          } /* end of action switch */
 1411                  } /* end of scanning one token */
 1412  } /* end of df_lex */
Show more  




Change Warning 1134.30443 : Unreachable Control Flow

Because they are very similar, this warning shares annotations with 39 other warnings.   show all

Priority:
State:
Finding:
Owner:
Note: