Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | #include "src/dex_verifier.h" |
| 4 | |
| 5 | |
| 6 | namespace art { |
| 7 | |
| 8 | bool DexVerify::VerifyClass(Class* klass) { |
| 9 | if (klass->IsVerified()) { |
| 10 | return true; |
| 11 | } |
| 12 | for (size_t i = 0; i < klass->NumDirectMethods(); ++i) { |
| 13 | Method* method = klass->GetDirectMethod(i); |
| 14 | if (!VerifyMethod(method)) { |
| 15 | LG << "Verifier rejected class " << klass->GetDescriptor(); |
| 16 | return false; |
| 17 | } |
| 18 | } |
| 19 | for (size_t i = 0; i < klass->NumVirtualMethods(); ++i) { |
| 20 | Method* method = klass->GetVirtualMethod(i); |
| 21 | if (!VerifyMethod(method)) { |
| 22 | LG << "Verifier rejected class " << klass->GetDescriptor(); |
| 23 | return false; |
| 24 | } |
| 25 | } |
| 26 | return true; |
| 27 | } |
| 28 | |
| 29 | bool DexVerify::VerifyMethod(Method* method) { |
| 30 | return true; // TODO |
| 31 | } |
| 32 | |
| 33 | } // namespace art |