History

fix end-of-buffer error in tccpp.c

Quick fix for http://lists.nongnu.org/archive/html/tinycc-devel/2015-04/msg00160.html. I don't fully understand the intended semantics of when file->buf_ptr[0] is valid, but the rest of the code doesn't have any obvious spots with the same bug. Feel free to revert this if I'm mistaken or we need to discuss this change further.

Philip committed 11 years ago

Commit 2e04fa81 parent 41260561 file · +1 −1Browse files

Unified · Split

tccpp.c+1−1
@@ -2888,7 +2888,7 @@ static int macro_subst_tok(TokenString *tok_str, · 2887 unmodified lines
2888 goto redo;2888 goto redo;
2889 }2889 }
2890 } else {2890 } else {
2891 ch = file->buf_ptr[0];2891 ch = tcc_peekc_slow(file);
2892 while (is_space(ch) || ch == '\n' || ch == '/')2892 while (is_space(ch) || ch == '\n' || ch == '/')
2893 {2893 {
2894 if (ch == '/')2894 if (ch == '/')

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t