diff options
author | Efimov Vasily <real@ispras.ru> | 2016-02-09 20:27:24 +0300 |
---|---|---|
committer | Efimov Vasily <real@ispras.ru> | 2017-10-30 19:58:51 +0300 |
commit | 5a74b95cfb2faca7470fd814f10bd9d0650c3a4a (patch) | |
tree | a5ae8bdf5402d095df91d213846f80852f18de31 | |
parent | e71a4a041b87b8173f7b39b75a56fc2406736a38 (diff) | |
download | ply-5a74b95cfb2faca7470fd814f10bd9d0650c3a4a.tar.gz |
cpp: check token list bounds during macro expansion
Signed-off-by: Efimov Vasily <real@ispras.ru>
-rw-r--r-- | ply/cpp.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -510,7 +510,7 @@ class Preprocessor(object): j = i + 1 while j < len(tokens) and tokens[j].type in self.t_WS: j += 1 - if tokens[j].value == '(': + if j < len(tokens) and tokens[j].value == '(': tokcount,args,positions = self.collect_args(tokens[j:]) if not m.variadic and len(args) != len(m.arglist): self.error(self.source,t.lineno,"Macro %s requires %d arguments" % (t.value,len(m.arglist))) |