From a0d62e041f426e2c4ce14c5e2880f96dcfb2d4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 5 Jan 2011 19:38:22 +0100 Subject: [PATCH] Tokenizer: Fixed memory corruption --- lib/tokenize.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 0c630aa4c..66f4c8f09 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4898,7 +4898,8 @@ bool Tokenizer::simplifyConditions() else if (Token::simpleMatch(tok, "|| true )") || Token::simpleMatch(tok, "&& false )")) { - Token::eraseTokens(tok->tokAt(2)->link(), tok->next()); + tok = tok->next(); + Token::eraseTokens(tok->next()->link(), tok); ret = true; }