From 1aac8f3e5260b7b3c56fc8b4d55281c4780a8649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 12 Jan 2010 22:33:47 +0100 Subject: [PATCH] Uninitialized variables: disable subfunction analysis if multiple threads are used --- lib/checkother.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index bfe9136c0..894ae561d 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1959,7 +1959,10 @@ void CheckOther::executionPaths() // check if variable is accessed uninitialized.. { - CheckUninitVar::analyseFunctions(_tokenizer->tokens(), CheckUninitVar::uvarFunctions); + // no writing if multiple threads are used (TODO: thread safe analysis?) + if (_settings->_jobs == 1) + CheckUninitVar::analyseFunctions(_tokenizer->tokens(), CheckUninitVar::uvarFunctions); + CheckUninitVar c(this); checkExecutionPaths(_tokenizer->tokens(), &c); }