summaryrefslogtreecommitdiff
path: root/runtime/oat_quick_method_header.h
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2019-04-03 13:56:22 +0100
committer David Srbecky <dsrbecky@google.com> 2019-04-16 12:53:02 +0000
commit1eb5d8770a533b86269e503a842f6b45591e87cf (patch)
tree222728b3902587c45ad7c294c7ba69393f8d7cfa /runtime/oat_quick_method_header.h
parent9b70ee0fdb1969a9a5cad2052b35c2fa04509bc2 (diff)
Prefix entrypoints with 0xFF so we can do extra checks.
Add check to ensure we do not read method header from libart.so Bug: 123510633 Test: m -j40 cts && cts-tradefed run cts \ --test android.jvmti.cts.JvmtiHostTest1927#testJvmti \ --module CtsJvmtiRunTest1927HostTestCases Change-Id: Ic3e42e3bd4fbda3b11c7e265ed114770139151b9
Diffstat (limited to 'runtime/oat_quick_method_header.h')
-rw-r--r--runtime/oat_quick_method_header.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/oat_quick_method_header.h b/runtime/oat_quick_method_header.h
index 8798c6968c..e41c7eef68 100644
--- a/runtime/oat_quick_method_header.h
+++ b/runtime/oat_quick_method_header.h
@@ -76,6 +76,10 @@ class PACKED(4) OatQuickMethodHeader {
}
uint32_t GetCodeSize() const {
+ // ART compiled method are prefixed with header, but we can also easily
+ // accidentally use a function pointer to one of the stubs/trampolines.
+ // We prefix those with 0xFF in the aseembly so that we can do DCHECKs.
+ CHECK_NE(code_size_, 0xFFFFFFFF) << code_;
return code_size_ & kCodeSizeMask;
}