From 4eeac1f364fe96a7c2214fd5e2dc5d928c521fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 27 Mar 2009 15:12:49 +0100 Subject: [PATCH] tokenizer: fix segmentation fault if end of token list is reached --- src/tokenize.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index bbfb12fc1..ee8d99260 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -641,6 +641,10 @@ void Tokenizer::setVarId() tok2 = tok2->next(); } + // End of tokens reached.. + if (!tok2) + break; + // Is it a function? if (tok2->str() == "(") {