summaryrefslogtreecommitdiffstats
path: root/vm/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'vm/analysis')
-rw-r--r--vm/analysis/CodeVerify.cpp7
-rw-r--r--vm/analysis/DexPrepare.cpp4
-rw-r--r--vm/analysis/VfyBasicBlock.cpp5
3 files changed, 15 insertions, 1 deletions
diff --git a/vm/analysis/CodeVerify.cpp b/vm/analysis/CodeVerify.cpp
index 4a0d3d71d..a230590db 100644
--- a/vm/analysis/CodeVerify.cpp
+++ b/vm/analysis/CodeVerify.cpp
@@ -3737,7 +3737,7 @@ static bool doCodeVerification(VerifierData* vdata, RegisterTable* regTable)
if (instr == kPackedSwitchSignature ||
instr == kSparseSwitchSignature ||
instr == kArrayDataSignature ||
- (instr == OP_NOP &&
+ (instr == OP_NOP && (insnIdx + 1 < insnsSize) &&
(meth->insns[insnIdx+1] == kPackedSwitchSignature ||
meth->insns[insnIdx+1] == kSparseSwitchSignature ||
meth->insns[insnIdx+1] == kArrayDataSignature)))
@@ -4318,6 +4318,11 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
valueType = primitiveTypeToRegType(
resClass->elementClass->primitiveType);
assert(valueType != kRegTypeUnknown);
+#ifdef NDEBUG
+ // assert is optimized out, leaving valueType defined but
+ // not used, causing a compiler warning -> error on -Werror
+ (void)valueType;
+#endif
/*
* Now verify if the element width in the table matches the element
diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp
index e8112d543..82e2c0605 100644
--- a/vm/analysis/DexPrepare.cpp
+++ b/vm/analysis/DexPrepare.cpp
@@ -1043,7 +1043,9 @@ static void verifyAndOptimizeClasses(DexFile* pDexFile, bool doVerify,
static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
const DexClassDef* pClassDef, bool doVerify, bool doOpt)
{
+#ifndef LOG_NDEBUG
const char* classDescriptor;
+#endif
bool verified = false;
if (clazz->pDvmDex->pDexFile != pDexFile) {
@@ -1059,7 +1061,9 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
return;
}
+#ifndef LOG_NDEBUG
classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx);
+#endif
/*
* First, try to verify it.
diff --git a/vm/analysis/VfyBasicBlock.cpp b/vm/analysis/VfyBasicBlock.cpp
index d6c4b79df..346e4206f 100644
--- a/vm/analysis/VfyBasicBlock.cpp
+++ b/vm/analysis/VfyBasicBlock.cpp
@@ -178,6 +178,11 @@ static bool setPredecessors(VerifierData* vdata, VfyBasicBlock* curBlock,
gotBranch = dvmGetBranchOffset(meth, insnFlags, curIdx,
&branchOffset, &unused);
assert(gotBranch);
+#ifdef NDEBUG
+ // assert is optimized out, leaving gotBranch defined but
+ // not used, causing a compiler warning -> error on -Werror
+ (void)gotBranch;
+#endif
absOffset = curIdx + branchOffset;
assert(absOffset >= 0 && (u4) absOffset < vdata->insnsSize);