Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at dtd_preparse.c:1003

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

Dtd_PreParse_lex

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dtd_preparse.c)expand/collapse
Show more  
 816  YY_DECL 
 817  {
 818          register yy_state_type yy_current_state;
 819          register char *yy_cp, *yy_bp;
 820          register int yy_act;
 821       
 822  #line 122 "dtd_preparse.l"
 823   
 824   
 825   
 826  #line 827 "dtd_preparse.c"
 827   
 828          if ( !(yy_init) )
 829                  {
 830                  (yy_init) = 1;
 831   
 832  #ifdef YY_USER_INIT 
 833                  YY_USER_INIT;
 834  #endif
 835   
 836                  if ( ! (yy_start) )
 837                          (yy_start) = 1; /* first start state */
 838   
 839                  if ( ! Dtd_PreParse_in )
 840                          Dtd_PreParse_in = stdin;
 841   
 842                  if ( ! Dtd_PreParse_out )
 843                          Dtd_PreParse_out = stdout;
 844   
 845                  if ( ! YY_CURRENT_BUFFER ) {
 846                          Dtd_PreParse_ensure_buffer_stack ();
 847                          YY_CURRENT_BUFFER_LVALUE =
 848                                  Dtd_PreParse__create_buffer(Dtd_PreParse_in,YY_BUF_SIZE );
 849                  }
 850   
 851                  Dtd_PreParse__load_buffer_state( );
 852                  }
 853   
 854          while ( 1 )             /* loops until end-of-file is reached */
 855                  {
 856                  yy_cp = (yy_c_buf_p);
 857   
 858                  /* Support of Dtd_PreParse_text. */
 859                  *yy_cp = (yy_hold_char);
 860   
 861                  /* yy_bp points to the position in yy_ch_buf of the start of 
 862                   * the current run.
 863                   */
 864                  yy_bp = yy_cp;
 865   
 866                  yy_current_state = (yy_start);
 867  yy_match:
 868                  do 
 869                          {
 870                          register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 871                          if ( yy_accept[yy_current_state] )
 872                                  {
 873                                  (yy_last_accepting_state) = yy_current_state;
 874                                  (yy_last_accepting_cpos) = yy_cp;
 875                                  }
 876                          while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 877                                  {
 878                                  yy_current_state = (int) yy_def[yy_current_state];
 879                                  if ( yy_current_state >= 78 )
 880                                          yy_c = yy_meta[(unsigned int) yy_c];
 881                                  }
 882                          yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 883                          ++yy_cp;
 884                          }
 885                  while ( yy_current_state != 77 );
 886                  yy_cp = (yy_last_accepting_cpos);
 887                  yy_current_state = (yy_last_accepting_state);
 888   
 889  yy_find_action:
 890                  yy_act = yy_accept[yy_current_state];
 891   
 892                  YY_DO_BEFORE_ACTION;
 893   
 894  do_action:      /* This label is used only to access EOF actions. */
 895   
 896                  switch ( yy_act )
 897          { /* beginning of action switch */
 898                          case 0: /* must back up */
 899                          /* undo the effects of YY_DO_BEFORE_ACTION */
 900                          *yy_cp = (yy_hold_char);
 901                          yy_cp = (yy_last_accepting_cpos);
 902                          yy_current_state = (yy_last_accepting_state);
 903                          goto yy_find_action;
 904   
 905  case 1:
 906  YY_RULE_SETUP 
 907  #line 125 "dtd_preparse.l"
 908  if (current) g_string_append_printf(current,"%s\n%s\n",replace_entity(Dtd_PreParse_text),location());
 909          YY_BREAK 
 910  case 2:
 911  YY_RULE_SETUP 
 912  #line 127 "dtd_preparse.l"
 913  if (current) g_string_append(current," ");
 914          YY_BREAK 
 915  case 3:
 916  YY_RULE_SETUP 
 917  #line 129 "dtd_preparse.l"
 918  { g_string_append(current,Dtd_PreParse_text); BEGIN XMLPI; }
 919          YY_BREAK 
 920  case 4:
 921  YY_RULE_SETUP 
 922  #line 130 "dtd_preparse.l"
 923  { g_string_append(current,Dtd_PreParse_text); }
 924          YY_BREAK 
 925  case 5:
 926  /* rule 5 can match eol */
 927  YY_RULE_SETUP 
 928  #line 131 "dtd_preparse.l"
 929  { g_string_append(current,Dtd_PreParse_text); }
 930          YY_BREAK 
 931  case 6:
 932  YY_RULE_SETUP 
 933  #line 132 "dtd_preparse.l"
 934  { g_string_append(current,Dtd_PreParse_text); BEGIN OUTSIDE; }
 935          YY_BREAK 
 936  case 7:
 937  YY_RULE_SETUP 
 938  #line 134 "dtd_preparse.l"
 939  { current = NULL; BEGIN IN_COMMENT; }
 940          YY_BREAK 
 941  case 8:
 942  /* rule 8 can match eol */
 943  #line 136 "dtd_preparse.l"
 944  case 9:
 945  /* rule 9 can match eol */
 946  YY_RULE_SETUP 
 947  #line 136 "dtd_preparse.l"
 948  ;
 949          YY_BREAK 
 950  case 10:
 951  YY_RULE_SETUP 
 952  #line 137 "dtd_preparse.l"
 953  { current = output; BEGIN OUTSIDE; }
 954          YY_BREAK 
 955  case 11:
 956  /* rule 11 can match eol */
 957  YY_RULE_SETUP 
 958  #line 139 "dtd_preparse.l"
 959  {
 960          linenum++;
 961          if (current) g_string_append_printf(current,"%s\n",location());
 962  }
 963          YY_BREAK 
 964  case 12:
 965  /* rule 12 can match eol */
 966  YY_RULE_SETUP 
 967  #line 145 "dtd_preparse.l"
 968  { BEGIN IN_ENTITY; }
 969          YY_BREAK 
 970  case 13:
 971  YY_RULE_SETUP 
 972  #line 146 "dtd_preparse.l"
 973  { entity_name = g_strdup_printf("%%%s;",Dtd_PreParse_text); BEGIN NAMED_ENTITY; }
 974          YY_BREAK 
 975  case 14:
 976  YY_RULE_SETUP 
 977  #line 147 "dtd_preparse.l"
 978  { current = g_string_new(location()); BEGIN IN_QUOTE; }
 979          YY_BREAK 
 980  case 15:
 981  YY_RULE_SETUP 
 982  #line 148 "dtd_preparse.l"
 983  { g_hash_table_insert(entities,entity_name,current);  BEGIN ENTITY_DONE; }
 984          YY_BREAK 
 985  case 16:
 986  #line 150 "dtd_preparse.l"
 987  case 17:
 988  /* rule 17 can match eol */
 989  #line 151 "dtd_preparse.l"
 990  case 18:
 991  /* rule 18 can match eol */
 992  YY_RULE_SETUP 
 993  #line 151 "dtd_preparse.l"
 994  g_string_append(current,Dtd_PreParse_text);
 995          YY_BREAK 
 996  case 19:
 997  YY_RULE_SETUP 
 998  #line 152 "dtd_preparse.l"
 999  {
 1000      g_string_append_printf(error,"at %s:%u: file inclusion is not supported!", filename, linenum);
 1001      yyterminate();
 1002  }
 1003          YY_BREAK 
 1004  case 20:
 1005  YY_RULE_SETUP 
 1006  #line 156 "dtd_preparse.l"
 1007  { current = output; g_string_append(current,"\n"); BEGIN OUTSIDE; }
 1008          YY_BREAK 
 1009  case 21:
 1010  YY_RULE_SETUP 
 1011  #line 158 "dtd_preparse.l"
 1012  ECHO;
 1013          YY_BREAK 
 1014  #line 1015 "dtd_preparse.c"
 1015  case YY_STATE_EOF(INITIAL):
 1016  case YY_STATE_EOF(OUTSIDE):
 1017  case YY_STATE_EOF(IN_COMMENT):
 1018  case YY_STATE_EOF(IN_ENTITY):
 1019  case YY_STATE_EOF(NAMED_ENTITY):
 1020  case YY_STATE_EOF(IN_QUOTE):
 1021  case YY_STATE_EOF(ENTITY_DONE):
 1022  case YY_STATE_EOF(XMLPI):
 1023          yyterminate();
 1024   
 1025          case YY_END_OF_BUFFER:
 1026                  {
 1027                  /* Amount of text matched not including the EOB char. */
 1028                  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 1029   
 1030                  /* Undo the effects of YY_DO_BEFORE_ACTION. */
 1031                  *yy_cp = (yy_hold_char);
 1032                  YY_RESTORE_YY_MORE_OFFSET 
 1033   
 1034                  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 1035                          {
 1036                          /* We're scanning a new file or input source.  It's
 1037                           * possible that this happened because the user 
 1038                           * just pointed Dtd_PreParse_in at a new source and called 
 1039                           * Dtd_PreParse_lex().  If so, then we have to assure 
 1040                           * consistency between YY_CURRENT_BUFFER and our 
 1041                           * globals.  Here is the right place to do so, because 
 1042                           * this is the first action (other than possibly a 
 1043                           * back-up) that will match for the new input source.
 1044                           */
 1045                          (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 1046                          YY_CURRENT_BUFFER_LVALUE->yy_input_file = Dtd_PreParse_in;
 1047                          YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 1048                          }
 1049   
 1050                  /* Note that here we test for yy_c_buf_p "<=" to the position 
 1051                   * of the first EOB in the buffer, since yy_c_buf_p will 
 1052                   * already have been incremented past the NUL character
 1053                   * (since all states make transitions on EOB to the
 1054                   * end-of-buffer state).  Contrast this with the test
 1055                   * in input().
 1056                   */
 1057                  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 1058                          { /* This was really a NUL. */
 1059                          yy_state_type yy_next_state;
 1060   
 1061                          (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 1062   
 1063                          yy_current_state = yy_get_previous_state(  );
 1064   
 1065                          /* Okay, we're now positioned to make the NUL
 1066                           * transition.  We couldn't have 
 1067                           * yy_get_previous_state() go ahead and do it 
 1068                           * for us because it doesn't know how to deal
 1069                           * with the possibility of jamming (and we don't
 1070                           * want to build jamming into it because then it 
 1071                           * will run more slowly).
 1072                           */
 1073   
 1074                          yy_next_state = yy_try_NUL_trans( yy_current_state );
 1075   
 1076                          yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1077   
 1078                          if ( yy_next_state )
 1079                                  {
 1080                                  /* Consume the NUL. */
 1081                                  yy_cp = ++(yy_c_buf_p);
 1082                                  yy_current_state = yy_next_state;
 1083                                  goto yy_match;
 1084                                  }
 1085   
 1086                          else 
 1087                                  {
 1088                                  yy_cp = (yy_last_accepting_cpos);
 1089                                  yy_current_state = (yy_last_accepting_state);
 1090                                  goto yy_find_action;
 1091                                  }
 1092                          }
 1093   
 1094                  else switch ( yy_get_next_buffer(  ) )
 1095                          {
 1096                          case EOB_ACT_END_OF_FILE:
 1097                                  {
 1098                                  (yy_did_buffer_switch_on_eof) = 0;
 1099   
 1100                                  if ( Dtd_PreParse_wrap( ) )
 1101                                          {
 1102                                          /* Note: because we've taken care in 
 1103                                           * yy_get_next_buffer() to have set up
 1104                                           * Dtd_PreParse_text, we can now set up 
 1105                                           * yy_c_buf_p so that if some total
 1106                                           * hoser (like flex itself) wants to
 1107                                           * call the scanner after we return the 
 1108                                           * YY_NULL, it'll still work - another 
 1109                                           * YY_NULL will get returned.
 1110                                           */
 1111                                          (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 1112   
 1113                                          yy_act = YY_STATE_EOF(YY_START);
 1114                                          goto do_action;
 1115                                          }
 1116   
 1117                                  else 
 1118                                          {
 1119                                          if ( ! (yy_did_buffer_switch_on_eof) )
 1120                                                  YY_NEW_FILE;
 1121                                          }
 1122                                  break;
 1123                                  }
 1124   
 1125                          case EOB_ACT_CONTINUE_SCAN:
 1126                                  (yy_c_buf_p) =
 1127                                          (yytext_ptr) + yy_amount_of_matched_text;
 1128   
 1129                                  yy_current_state = yy_get_previous_state(  );
 1130   
 1131                                  yy_cp = (yy_c_buf_p);
 1132                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1133                                  goto yy_match;
 1134   
 1135                          case EOB_ACT_LAST_MATCH:
 1136                                  (yy_c_buf_p) =
 1137                                  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 1138   
 1139                                  yy_current_state = yy_get_previous_state(  );
 1140   
 1141                                  yy_cp = (yy_c_buf_p);
 1142                                  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 1143                                  goto yy_find_action;
 1144                          }
 1145                  break;
 1146                  }
 1147   
 1148          default:
 1149                  YY_FATAL_ERROR(
 1150                          "fatal flex scanner internal error--no action found" );
 1151          } /* end of action switch */
 1152                  } /* end of scanning one token */
 1153  } /* end of Dtd_PreParse_lex */
Show more  




Change Warning 3072.30356 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: