mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-06 06:40:07 +08:00
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.
This commit is contained in:
parent
4126056fbe
commit
2e04fa8872
2
tccpp.c
2
tccpp.c
@ -2888,7 +2888,7 @@ static int macro_subst_tok(TokenString *tok_str,
|
|||||||
goto redo;
|
goto redo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ch = file->buf_ptr[0];
|
ch = tcc_peekc_slow(file);
|
||||||
while (is_space(ch) || ch == '\n' || ch == '/')
|
while (is_space(ch) || ch == '\n' || ch == '/')
|
||||||
{
|
{
|
||||||
if (ch == '/')
|
if (ch == '/')
|
||||||
|
Loading…
Reference in New Issue
Block a user