summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-20 08:49:29 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-20 08:49:29 +0000
commitac6130e23b3b5a7af8f35a94c0407d439f88b42d (patch)
treedc4d39f9592a60ca2a837bf659520bd477589647
parent23da77dd7e61f1117afe16854fe4203b3dd50626 (diff)
downloadgcc-ac6130e23b3b5a7af8f35a94c0407d439f88b42d.tar.gz
Fix thinko in _cpp_remaining_tokens_num_in_context
libcpp/ * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of number of tokens. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180239 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/lex.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index bbb4085f012..128d3e1cec0 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR bootstrap/50801
+ * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
+ number of tokens.
+
2011-10-18 Dodji Seketeli <dodji@redhat.com>
PR bootstrap/50760
diff --git a/libcpp/lex.c b/libcpp/lex.c
index cd6ae9f67dd..527368b8607 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -1710,12 +1710,10 @@ _cpp_remaining_tokens_num_in_context (cpp_reader *pfile)
{
cpp_context *context = pfile->context;
if (context->tokens_kind == TOKENS_KIND_DIRECT)
- return ((LAST (context).token - FIRST (context).token)
- / sizeof (cpp_token));
+ return (LAST (context).token - FIRST (context).token);
else if (context->tokens_kind == TOKENS_KIND_INDIRECT
|| context->tokens_kind == TOKENS_KIND_EXTENDED)
- return ((LAST (context).ptoken - FIRST (context).ptoken)
- / sizeof (cpp_token *));
+ return (LAST (context).ptoken - FIRST (context).ptoken);
else
abort ();
}