Fix relex init garbage problem
This commit is contained in:
parent
774723be04
commit
acd48742d9
|
@ -1620,7 +1620,12 @@ DOC_SEE(cpp_relex_is_start_chunk)
|
||||||
state.end_token_index = range.end_token_index;
|
state.end_token_index = range.end_token_index;
|
||||||
state.original_end_token_index = range.end_token_index;
|
state.original_end_token_index = range.end_token_index;
|
||||||
|
|
||||||
|
if (state.start_token_index < array->count){
|
||||||
state.relex_start_position = array->tokens[state.start_token_index].start;
|
state.relex_start_position = array->tokens[state.start_token_index].start;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
state.relex_start_position = 0;
|
||||||
|
}
|
||||||
if (start_pos < state.relex_start_position){
|
if (start_pos < state.relex_start_position){
|
||||||
state.relex_start_position = start_pos;
|
state.relex_start_position = start_pos;
|
||||||
}
|
}
|
||||||
|
@ -1628,7 +1633,12 @@ DOC_SEE(cpp_relex_is_start_chunk)
|
||||||
state.character_shift_amount = character_shift_amount;
|
state.character_shift_amount = character_shift_amount;
|
||||||
|
|
||||||
state.lex = cpp_lex_data_init(ignore_string_delims, keywords, preprocessor_words);
|
state.lex = cpp_lex_data_init(ignore_string_delims, keywords, preprocessor_words);
|
||||||
|
if (state.start_token_index < array->count){
|
||||||
state.lex.pp_state = cpp_token_get_pp_state(array->tokens[state.start_token_index].state_flags);
|
state.lex.pp_state = cpp_token_get_pp_state(array->tokens[state.start_token_index].state_flags);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
state.lex.pp_state = 0;
|
||||||
|
}
|
||||||
state.lex.pos = state.relex_start_position;
|
state.lex.pos = state.relex_start_position;
|
||||||
|
|
||||||
return(state);
|
return(state);
|
||||||
|
|
Loading…
Reference in New Issue