From eadc07e269b864b9de22d2f747747bf41eb9ef5d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 22 Jan 2019 18:37:11 -0500 Subject: [PATCH] a32_unicorn: Silence a truncation warning within UnmappedMemoryHook() MemoryRead8() takes a u32, but we were passing the result of a u32 + size_t operation, which is 64-bit on 64-bit platforms. This results in a truncation warning --- tests/unicorn_emu/a32_unicorn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unicorn_emu/a32_unicorn.cpp b/tests/unicorn_emu/a32_unicorn.cpp index 3fdf598b..58cd1bc8 100644 --- a/tests/unicorn_emu/a32_unicorn.cpp +++ b/tests/unicorn_emu/a32_unicorn.cpp @@ -178,7 +178,7 @@ bool A32Unicorn::UnmappedMemoryHook(uc_engine* uc, uc_mem_type /*type*/, u32 sta auto page = std::make_unique(); page->address = base_address; for (size_t i = 0; i < page->data.size(); ++i) - page->data[i] = this_->testenv.MemoryRead8(base_address + i); + page->data[i] = this_->testenv.MemoryRead8(static_cast(base_address + i)); uc_err err = uc_mem_map_ptr(uc, base_address, page->data.size(), permissions, page->data.data()); if (err == UC_ERR_MAP)