Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at uat_load.c:1068

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

uat_load_lex

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/uat_load.c)expand/collapse
Show more  
 801  YY_DECL 
 802  {
 803          register yy_state_type yy_current_state;
 804          register char *yy_cp, *yy_bp;
 805          register int yy_act;
 806       
 807  #line 149 "uat_load.l"
 808   
 809  #line 810 "uat_load.c"
 810   
 811          if ( !(yy_init) )
 812                  {
 813                  (yy_init) = 1;
 814   
 815  #ifdef YY_USER_INIT 
 816                  YY_USER_INIT;
 817  #endif
 818   
 819                  if ( ! (yy_start) )
 820                          (yy_start) = 1; /* first start state */
 821   
 822                  if ( ! uat_load_in )
 823                          uat_load_in = stdin;
 824   
 825                  if ( ! uat_load_out )
 826                          uat_load_out = stdout;
 827   
 828                  if ( ! YY_CURRENT_BUFFER ) {
 829                          uat_load_ensure_buffer_stack ();
 830                          YY_CURRENT_BUFFER_LVALUE =
 831                                  uat_load__create_buffer(uat_load_in,YY_BUF_SIZE );
 832                  }
 833   
 834                  uat_load__load_buffer_state( );
 835                  }
 836   
 837          while ( 1 )             /* loops until end-of-file is reached */
 838                  {
 839                  yy_cp = (yy_c_buf_p);
 840   
 841                  /* Support of uat_load_text. */
 842                  *yy_cp = (yy_hold_char);
 843   
 844                  /* yy_bp points to the position in yy_ch_buf of the start of 
 845                   * the current run.
 846                   */
 847                  yy_bp = yy_cp;
 848   
 849                  yy_current_state = (yy_start);
 850  yy_match:
 851                  do 
 852                          {
 853                          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 854                          if ( yy_accept[yy_current_state] )
 855                                  {
 856                                  (yy_last_accepting_state) = yy_current_state;
 857                                  (yy_last_accepting_cpos) = yy_cp;
 858                                  }
 859                          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 860                                  {
 861                                  yy_current_state = (int) yy_def[yy_current_state];
 862                                  if ( yy_current_state >= 73 )
 863                                          yy_c = yy_meta[(unsigned int) yy_c];
 864                                  }
 865                          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 866                          ++yy_cp;
 867                          }
 868                  while ( yy_current_state != 72 );
 869                  yy_cp = (yy_last_accepting_cpos);
 870                  yy_current_state = (yy_last_accepting_state);
 871   
 872  yy_find_action:
 873                  yy_act = yy_accept[yy_current_state];
 874   
 875                  YY_DO_BEFORE_ACTION;
 876   
 877  do_action:      /* This label is used only to access EOF actions. */
 878   
 879                  switch ( yy_act )
 880          { /* beginning of action switch */
 881                          case 0: /* must back up */
 882                          /* undo the effects of YY_DO_BEFORE_ACTION */
 883                          *yy_cp = (yy_hold_char);
 884                          yy_cp = (yy_last_accepting_cpos);
 885                          yy_current_state = (yy_last_accepting_state);
 886                          goto yy_find_action;
 887   
 888  case 1:
 889  YY_RULE_SETUP 
 890  #line 150 "uat_load.l"
 891  ;
 892          YY_BREAK 
 893  case 2:
 894  /* rule 2 can match eol */
 895  YY_RULE_SETUP 
 896  #line 151 "uat_load.l"
 897  linenum++;
 898          YY_BREAK 
 899  case 3:
 900  /* rule 3 can match eol */
 901  YY_RULE_SETUP 
 902  #line 152 "uat_load.l"
 903  linenum++;
 904          YY_BREAK 
 905  case 4:
 906  YY_RULE_SETUP 
 907  #line 154 "uat_load.l"
 908  {
 909          ptr = g_strdup("");
 910          len = 0;
 911   
 912          DUMP_FIELD("empty->next");
 913   
 914          SET_FIELD();
 915   
 916          if ( colnum >= uat->ncols ) {
 917                  ERROR(("more fields than required"));
 918          }
 919   
 920          BEGIN NEXT_FIELD;
 921  }
 922          YY_BREAK 
 923  case 5:
 924  /* rule 5 can match eol */
 925  YY_RULE_SETUP 
 926  #line 169 "uat_load.l"
 927  {
 928          ptr = "";
 929          len = 0;
 930   
 931          BEGIN END_OF_RECORD;
 932   
 933          yyless(uat_load_leng);
 934  }
 935          YY_BREAK 
 936  case 6:
 937  /* rule 6 can match eol */
 938  YY_RULE_SETUP 
 939  #line 178 "uat_load.l"
 940  {
 941          ptr = uat_undquote(uat_load_text,uat_load_leng,&len);
 942   
 943   
 944          if (colnum < uat->ncols - 1) {
 945                  DUMP("quoted_str->s");
 946                  BEGIN SEPARATOR;
 947          } else {
 948                  DUMP("quoted_str->eor");
 949                  BEGIN END_OF_RECORD;
 950          }
 951  }
 952          YY_BREAK 
 953  case 7:
 954  YY_RULE_SETUP 
 955  #line 191 "uat_load.l"
 956  {
 957          ptr = uat_unbinstring(uat_load_text,uat_load_leng,&len);
 958   
 959          if (!ptr) {
 960                  ERROR(("uneven hexstring for field %s",uat->fields[colnum].name));
 961          }
 962   
 963          if ( colnum < uat->ncols - 1 ) {
 964                  DUMP("binstring->s");
 965                  BEGIN SEPARATOR;
 966          } else {
 967                  DUMP("binstring->eor");
 968                  BEGIN END_OF_RECORD;
 969          }
 970  }
 971          YY_BREAK 
 972  case 8:
 973  YY_RULE_SETUP 
 974  #line 207 "uat_load.l"
 975  {
 976   
 977          DUMP_FIELD("separator->next");
 978   
 979          SET_FIELD();
 980   
 981          if ( colnum >= uat->ncols ) {
 982                  ERROR(("more fields than required"));
 983          }
 984   
 985          BEGIN NEXT_FIELD;
 986  }
 987          YY_BREAK 
 988  case 9:
 989  /* rule 9 can match eol */
 990  YY_RULE_SETUP 
 991  #line 220 "uat_load.l"
 992  {
 993          linenum++;
 994          ERROR(("expecting field %s in previous line",uat->fields[colnum].name));
 995          BEGIN START_OF_LINE;
 996  }
 997          YY_BREAK 
 998  case 10:
 999  YY_RULE_SETUP 
 1000  #line 226 "uat_load.l"
 1001  {
 1002          ERROR(("unexpected char '%s' while looking for field %s",uat_load_text,uat->fields[colnum].name));
 1003          BEGIN ERRORED;
 1004  }
 1005          YY_BREAK 
 1006  case 11:
 1007  YY_RULE_SETUP 
 1008  #line 231 "uat_load.l"
 1009  {
 1010          ERROR(("more fields than required"));
 1011          BEGIN ERRORED;
 1012  }
 1013          YY_BREAK 
 1014  case 12:
 1015  /* rule 12 can match eol */
 1016  YY_RULE_SETUP 
 1017  #line 236 "uat_load.l"
 1018  {
 1019          void* rec;
 1020          const gchar* err = NULL;
 1021   
 1022          linenum++;
 1023   
 1024          DUMP_FIELD("newline->start");
 1025   
 1026          SET_FIELD();
 1027   
 1028          rec = uat_add_record(uat, record);
 1029   
 1030          if (uat->update_cb)
 1031                  uat->update_cb(rec,&err);
 1032   
 1033          if (err) {
 1034                  ERROR(("%s",err));
 1035          }
 1036   
 1037          colnum = 0;;
 1038          ptr = NULL;
 1039          len = 0;
 1040          memset(record,0,uat->record_size);
 1041   
 1042          BEGIN START_OF_LINE;
 1043   }
 1044          YY_BREAK 
 1045  case 13:
 1046  YY_RULE_SETUP 
 1047  #line 263 "uat_load.l"
 1048  {
 1049          ERROR(("unexpected char while looking for end of line"));
 1050          BEGIN ERRORED;
 1051  }
 1052          YY_BREAK 
 1053  case 14:
 1054  /* rule 14 can match eol */
 1055  YY_RULE_SETUP 
 1056  #line 268 "uat_load.l"
 1057  { linenum++; BEGIN START_OF_LINE; }
 1058          YY_BREAK 
 1059  case 15:
 1060  YY_RULE_SETUP 
 1061  #line 269 "uat_load.l"
 1062  ;
 1063          YY_BREAK 
 1064  case 16:
 1065  /* rule 16 can match eol */
 1066  YY_RULE_SETUP 
 1067  #line 271 "uat_load.l"
 1068  { linenum++; ERROR(("incomplete record")); BEGIN START_OF_LINE; }
 1069          YY_BREAK 
 1070  case 17:
 1071  YY_RULE_SETUP 
 1072  #line 272 "uat_load.l"
 1073  { ERROR(("unexpected input")); }
 1074          YY_BREAK 
 1075  case 18:
 1076  YY_RULE_SETUP 
 1077  #line 274 "uat_load.l"
 1078  ECHO;
 1079          YY_BREAK 
 1080  #line 1081 "uat_load.c"
 1081  case YY_STATE_EOF(INITIAL):
 1082  case YY_STATE_EOF(START_OF_LINE):
 1083  case YY_STATE_EOF(NEXT_FIELD):
 1084  case YY_STATE_EOF(SEPARATOR):
 1085  case YY_STATE_EOF(END_OF_RECORD):
 1086  case YY_STATE_EOF(ERRORED):
 1087          yyterminate();
 1088   
 1089          case YY_END_OF_BUFFER:
 1090                  {
 1091                  /* Amount of text matched not including the EOB char. */
 1092                  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 1093   
 1094                  /* Undo the effects of YY_DO_BEFORE_ACTION. */
 1095                  *yy_cp = (yy_hold_char);
 1096                  YY_RESTORE_YY_MORE_OFFSET 
 1097   
 1098                  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 1099                          {
 1100                          /* We're scanning a new file or input source.  It's
 1101                           * possible that this happened because the user 
 1102                           * just pointed uat_load_in at a new source and called 
 1103                           * uat_load_lex().  If so, then we have to assure 
 1104                           * consistency between YY_CURRENT_BUFFER and our 
 1105                           * globals.  Here is the right place to do so, because 
 1106                           * this is the first action (other than possibly a 
 1107                           * back-up) that will match for the new input source.
 1108                           */
 1109                          (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 1110                          YY_CURRENT_BUFFER_LVALUE->yy_input_file = uat_load_in;
 1111                          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 1112                          }
 1113   
 1114                  /* Note that here we test for yy_c_buf_p "<=" to the position 
 1115                   * of the first EOB in the buffer, since yy_c_buf_p will 
 1116                   * already have been incremented past the NUL character
 1117                   * (since all states make transitions on EOB to the
 1118                   * end-of-buffer state).  Contrast this with the test
 1119                   * in input().
 1120                   */
 1121                  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 1122                          { /* This was really a NUL. */
 1123                          yy_state_type yy_next_state;
 1124   
 1125                          (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 1126   
 1127                          yy_current_state = yy_get_previous_state(  );
 1128   
 1129                          /* Okay, we're now positioned to make the NUL
 1130                           * transition.  We couldn't have 
 1131                           * yy_get_previous_state() go ahead and do it 
 1132                           * for us because it doesn't know how to deal
 1133                           * with the possibility of jamming (and we don't
 1134                           * want to build jamming into it because then it 
 1135                           * will run more slowly).
 1136                           */
 1137   
 1138                          yy_next_state = yy_try_NUL_trans( yy_current_state );
 1139   
 1140                          yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1141   
 1142                          if ( yy_next_state )
 1143                                  {
 1144                                  /* Consume the NUL. */
 1145                                  yy_cp = ++(yy_c_buf_p);
 1146                                  yy_current_state = yy_next_state;
 1147                                  goto yy_match;
 1148                                  }
 1149   
 1150                          else 
 1151                                  {
 1152                                  yy_cp = (yy_last_accepting_cpos);
 1153                                  yy_current_state = (yy_last_accepting_state);
 1154                                  goto yy_find_action;
 1155                                  }
 1156                          }
 1157   
 1158                  else switch ( yy_get_next_buffer(  ) )
 1159                          {
 1160                          case EOB_ACT_END_OF_FILE:
 1161                                  {
 1162                                  (yy_did_buffer_switch_on_eof) = 0;
 1163   
 1164                                  if ( uat_load_wrap( ) )
 1165                                          {
 1166                                          /* Note: because we've taken care in 
 1167                                           * yy_get_next_buffer() to have set up
 1168                                           * uat_load_text, we can now set up 
 1169                                           * yy_c_buf_p so that if some total
 1170                                           * hoser (like flex itself) wants to
 1171                                           * call the scanner after we return the 
 1172                                           * YY_NULL, it'll still work - another 
 1173                                           * YY_NULL will get returned.
 1174                                           */
 1175                                          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 1176   
 1177                                          yy_act = YY_STATE_EOF(YY_START);
 1178                                          goto do_action;
 1179                                          }
 1180   
 1181                                  else 
 1182                                          {
 1183                                          if ( ! (yy_did_buffer_switch_on_eof) )
 1184                                                  YY_NEW_FILE;
 1185                                          }
 1186                                  break;
 1187                                  }
 1188   
 1189                          case EOB_ACT_CONTINUE_SCAN:
 1190                                  (yy_c_buf_p) =
 1191                                          (yytext_ptr) + yy_amount_of_matched_text;
 1192   
 1193                                  yy_current_state = yy_get_previous_state(  );
 1194   
 1195                                  yy_cp = (yy_c_buf_p);
 1196                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1197                                  goto yy_match;
 1198   
 1199                          case EOB_ACT_LAST_MATCH:
 1200                                  (yy_c_buf_p) =
 1201                                  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 1202   
 1203                                  yy_current_state = yy_get_previous_state(  );
 1204   
 1205                                  yy_cp = (yy_c_buf_p);
 1206                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1207                                  goto yy_find_action;
 1208                          }
 1209                  break;
 1210                  }
 1211   
 1212          default:
 1213                  YY_FATAL_ERROR(
 1214                          "fatal flex scanner internal error--no action found" );
 1215          } /* end of action switch */
 1216                  } /* end of scanning one token */
 1217  } /* end of uat_load_lex */
Show more  




Change Warning 2654.30340 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: