From a18e6d135a869f9c62f9ec8bac8b9e78d92c697f Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Thu, 1 Dec 2011 12:24:49 -0800 Subject: [PATCH] Initialize the vC field of inlined getters/setters. To eliminate a benign Valgrind warning. Change-Id: I5f0ae53b8c86fe476f0b7ddfb6589191aea464f6 --- vm/compiler/InlineTransformation.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vm/compiler/InlineTransformation.cpp b/vm/compiler/InlineTransformation.cpp index 387dd6123..53278a7fb 100644 --- a/vm/compiler/InlineTransformation.cpp +++ b/vm/compiler/InlineTransformation.cpp @@ -46,6 +46,13 @@ static bool inlineGetter(CompilationUnit *cUnit, MIR *newGetterMIR = (MIR *)dvmCompilerNew(sizeof(MIR), true); DecodedInstruction getterInsn; + /* + * Not all getter instructions have vC but vC will be read by + * dvmCompilerGetDalvikDisassembly unconditionally. + * Initialize it here to get Valgrind happy. + */ + getterInsn.vC = 0; + dexDecodeInstruction(calleeMethod->insns, &getterInsn); if (!dvmCompilerCanIncludeThisInstruction(calleeMethod, &getterInsn)) @@ -137,6 +144,13 @@ static bool inlineSetter(CompilationUnit *cUnit, MIR *newSetterMIR = (MIR *)dvmCompilerNew(sizeof(MIR), true); DecodedInstruction setterInsn; + /* + * Not all setter instructions have vC but vC will be read by + * dvmCompilerGetDalvikDisassembly unconditionally. + * Initialize it here to get Valgrind happy. + */ + setterInsn.vC = 0; + dexDecodeInstruction(calleeMethod->insns, &setterInsn); if (!dvmCompilerCanIncludeThisInstruction(calleeMethod, &setterInsn)) -- 2.11.0