summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2018-06-20 10:39:31 -0700
committerAndreas Gampe <agampe@google.com>2018-06-20 10:40:56 -0700
commitb68ed2c708a5a3fcc8c2cec944c1080a6fbb88f5 (patch)
treedabb0134bd5f27ee99628a7eafe65b2b6212934c /compiler/common_compiler_test.cc
parent2e639002351545a76b0dbb2fbcb33c988d2d786e (diff)
ART: Ensure OatQuickMethodHeader is trivially copyable
Remove empty constructor. Test: mmma art Change-Id: Ie58721299a6675797e9a525f4eb7e6df82abed50
Diffstat (limited to 'compiler/common_compiler_test.cc')
-rw-r--r--compiler/common_compiler_test.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index a7f16d394e..1d4f020391 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -16,6 +16,8 @@
#include "common_compiler_test.h"
+#include <type_traits>
+
#include "arch/instruction_set_features.h"
#include "art_field-inl.h"
#include "art_method-inl.h"
@@ -79,6 +81,7 @@ void CommonCompilerTest::MakeExecutable(ArtMethod* method) {
const size_t size = method_info.size() + vmap_table.size() + sizeof(method_header) + code_size;
chunk->reserve(size + max_padding);
chunk->resize(sizeof(method_header));
+ static_assert(std::is_trivially_copyable<OatQuickMethodHeader>::value, "Cannot use memcpy");
memcpy(&(*chunk)[0], &method_header, sizeof(method_header));
chunk->insert(chunk->begin(), vmap_table.begin(), vmap_table.end());
chunk->insert(chunk->begin(), method_info.begin(), method_info.end());