From 0eb42511405f3919572a480a009426dfb776cfb5 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 26 May 2015 20:42:30 +0100 Subject: [PATCH] Fix mac build: cast fpr callee save addresses. Bring back reinterpret_cast<>s removed by https://android-review.googlesource.com/151309 . They are needed for mac builds. Bug : 13925192 Change-Id: I7728c39a867a278000c84d75440b31e818c3bfcf --- runtime/arch/x86/context_x86.cc | 6 ++++-- runtime/arch/x86_64/context_x86_64.cc | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/arch/x86/context_x86.cc b/runtime/arch/x86/context_x86.cc index 7a5d0c549..06bae7558 100644 --- a/runtime/arch/x86/context_x86.cc +++ b/runtime/arch/x86/context_x86.cc @@ -54,8 +54,10 @@ void X86Context::FillCalleeSaves(const StackVisitor& fr) { DCHECK_EQ(0u, fp_regs & (static_cast(-1) << kNumberOfFloatRegisters)); for (uint32_t fp_reg : HighToLowBits(fp_regs)) { // Two void* per XMM register. - fprs_[2 * fp_reg] = fr.CalleeSaveAddress(spill_pos + 1, frame_info.FrameSizeInBytes()); - fprs_[2 * fp_reg + 1] = fr.CalleeSaveAddress(spill_pos, frame_info.FrameSizeInBytes()); + fprs_[2 * fp_reg] = reinterpret_cast( + fr.CalleeSaveAddress(spill_pos + 1, frame_info.FrameSizeInBytes())); + fprs_[2 * fp_reg + 1] = reinterpret_cast( + fr.CalleeSaveAddress(spill_pos, frame_info.FrameSizeInBytes())); spill_pos += 2; } DCHECK_EQ(spill_pos, diff --git a/runtime/arch/x86_64/context_x86_64.cc b/runtime/arch/x86_64/context_x86_64.cc index de54e1463..2c4532c42 100644 --- a/runtime/arch/x86_64/context_x86_64.cc +++ b/runtime/arch/x86_64/context_x86_64.cc @@ -53,7 +53,8 @@ void X86_64Context::FillCalleeSaves(const StackVisitor& fr) { uint32_t fp_regs = frame_info.FpSpillMask(); DCHECK_EQ(0u, fp_regs & (static_cast(-1) << kNumberOfFloatRegisters)); for (uint32_t fp_reg : HighToLowBits(fp_regs)) { - fprs_[fp_reg] = fr.CalleeSaveAddress(spill_pos, frame_info.FrameSizeInBytes()); + fprs_[fp_reg] = reinterpret_cast( + fr.CalleeSaveAddress(spill_pos, frame_info.FrameSizeInBytes())); ++spill_pos; } DCHECK_EQ(spill_pos, -- 2.11.0