aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip <pipcet@gmail.com>2015-04-30 19:07:44 +0000
committerPhilip <pipcet@gmail.com>2015-04-30 19:27:43 +0000
commit2e04fa8872f38aea4eb96fd3424c3d6762b5262d (patch)
treebf59bda2e9f117ea65a7fed7fdc87947f9ddc488
parent4126056fbe62dfc7897b0b2c52abf9fdfbfbffda (diff)
downloadtinycc-2e04fa8872f38aea4eb96fd3424c3d6762b5262d.tar.gz
tinycc-2e04fa8872f38aea4eb96fd3424c3d6762b5262d.tar.bz2
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.
-rw-r--r--tccpp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tccpp.c b/tccpp.c
index 62bfa9a..b44296d 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -2888,7 +2888,7 @@ static int macro_subst_tok(TokenString *tok_str,
goto redo;
}
} else {
- ch = file->buf_ptr[0];
+ ch = tcc_peekc_slow(file);
while (is_space(ch) || ch == '\n' || ch == '/')
{
if (ch == '/')