From 6e0d162bdfcf85d825444672ee00e40ba423ba3a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 18 Jan 2013 20:22:07 +0100 Subject: [PATCH] Fix valgrind warnings about uninitialised variable Apparently gcc was miscompiling the code with boolean bitfields. Changing them to uint's makes all errors go away. Change-Id: I95e856e4b5ebca0d10fa250a8a4640697998ff38 Reviewed-by: Simon Hausmann --- qv4ir_p.h | 8 +++++--- qv4isel_p.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qv4ir_p.h b/qv4ir_p.h index 962aa45..03ac2ad 100644 --- a/qv4ir_p.h +++ b/qv4ir_p.h @@ -612,9 +612,10 @@ struct Function { int insideWith; - bool hasDirectEval: 1; - bool usesArgumentsObject : 1; - bool isStrict: 1; + uint hasDirectEval: 1; + uint usesArgumentsObject : 1; + uint isStrict: 1; + uint unused : 29; template _Tp *New() { return new (pool->allocate(sizeof(_Tp))) _Tp(); } @@ -627,6 +628,7 @@ struct Function { , hasDirectEval(false) , usesArgumentsObject(false) , isStrict(false) + , unused(0) { this->name = newString(name); } ~Function(); diff --git a/qv4isel_p.cpp b/qv4isel_p.cpp index da9b6cd..7c1c6cc 100644 --- a/qv4isel_p.cpp +++ b/qv4isel_p.cpp @@ -40,6 +40,7 @@ VM::Function *EvalInstructionSelection::createFunctionMapping(VM::ExecutionEngin vmFunction->hasDirectEval = irFunction->hasDirectEval; vmFunction->usesArgumentsObject = irFunction->usesArgumentsObject; + vmFunction->hasNestedFunctions = !irFunction->nestedFunctions.isEmpty(); vmFunction->isStrict = irFunction->isStrict; foreach (const QString *formal, irFunction->formals) @@ -52,7 +53,6 @@ VM::Function *EvalInstructionSelection::createFunctionMapping(VM::ExecutionEngin foreach (IR::Function *function, irFunction->nestedFunctions) createFunctionMapping(engine, function); - vmFunction->hasNestedFunctions = !irFunction->nestedFunctions.isEmpty(); if (engine->debugger) engine->debugger->mapFunction(vmFunction, irFunction); -- 2.7.4