Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid accessing unowned memory #17

Merged
merged 1 commit into from
Jan 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,10 @@ struct Scanner {

bool allow_comment = !(VLD[R_DQT_STR_CTN] || VLD[BR_DQT_STR_CTN] || VLD[R_SQT_STR_CTN] || VLD[BR_SQT_STR_CTN]);

int16_t *ind_ptr = &ind_len_stk.back();
int16_t cur_ind = *ind_ptr--;
int16_t prt_ind = *ind_ptr;
vector<int16_t>::reverse_iterator ind_ptr = ind_len_stk.rbegin();
vector<int16_t>::reverse_iterator ind_end = ind_len_stk.rend();
int16_t cur_ind = *ind_ptr++;
int16_t prt_ind = ind_ptr == ind_end ? -1 : *ind_ptr;
int16_t cur_ind_typ = ind_typ_stk.back();

bool has_tab_ind = false;
Expand Down