diff options
author | Elliott Hughes <enh@google.com> | 2013-05-13 18:50:41 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-05-13 18:50:41 +0000 |
commit | 9275963e79d1625120db610b78c3a0812ebb2922 (patch) | |
tree | 839b1ff8fb1ac762a14da9696e4ee03f768ece1a | |
parent | 130eebad44c24874fb940884bfd8d9cde58dc367 (diff) | |
parent | c2e9a5b2b70d69c027964c9a4d07a4bdf723dd36 (diff) | |
download | android_dalvik-9275963e79d1625120db610b78c3a0812ebb2922.tar.gz android_dalvik-9275963e79d1625120db610b78c3a0812ebb2922.tar.bz2 android_dalvik-9275963e79d1625120db610b78c3a0812ebb2922.zip |
Merge "Move verification of class access flags to libdex"
-rw-r--r-- | libdex/DexSwapVerify.cpp | 5 | ||||
-rw-r--r-- | vm/analysis/DexPrepare.cpp | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libdex/DexSwapVerify.cpp b/libdex/DexSwapVerify.cpp index 4b3cf4493..6cc139dcf 100644 --- a/libdex/DexSwapVerify.cpp +++ b/libdex/DexSwapVerify.cpp @@ -911,6 +911,11 @@ static void* swapClassDefItem(const CheckState* state, void* ptr) { SWAP_OFFSET4(item->annotationsOff); SWAP_OFFSET4(item->classDataOff); + if ((item->accessFlags & ~ACC_CLASS_MASK) != 0) { + ALOGE("Bogus class access flags %x", item->accessFlags); + return NULL; + } + return item + 1; } diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp index cef1996a2..e8112d543 100644 --- a/vm/analysis/DexPrepare.cpp +++ b/vm/analysis/DexPrepare.cpp @@ -967,12 +967,6 @@ static bool loadAllClasses(DvmDex* pDvmDex) classDescriptor = dexStringByTypeIdx(pDvmDex->pDexFile, pClassDef->classIdx); - if ((pClassDef->accessFlags & ~ACC_CLASS_MASK) != 0) { - ALOGE("DexOpt: invalid access flags 0x%08x for class '%s'", - pClassDef->accessFlags, classDescriptor); - return false; - } - ALOGV("+++ loading '%s'", classDescriptor); //newClass = dvmDefineClass(pDexFile, classDescriptor, // NULL); |