From a9672b7c30ef4d2408b0fc2e89db35fe35cc4546 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 15 Oct 2016 00:53:17 +0000 Subject: [PATCH] Use addressof to report base address of valptridx access --- common/main/valptridx.tcc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/main/valptridx.tcc b/common/main/valptridx.tcc index 45c2e94a8..fc491b321 100644 --- a/common/main/valptridx.tcc +++ b/common/main/valptridx.tcc @@ -9,6 +9,7 @@ #include #include #include "valptridx.h" +#include "compiler-addressof.h" namespace untyped_index_mismatch_exception { @@ -81,7 +82,7 @@ void valptridx::index_mismatch_exception::report(DXX_VALPTRIDX_REP { using namespace untyped_index_mismatch_exception; char buf[report_buffer_size]; - prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS static_cast(&array[0]), supplied_index, expected_pointer, actual_pointer, buf, array.size()); + prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS addressof(array), supplied_index, expected_pointer, actual_pointer, buf, array.size()); throw index_mismatch_exception(buf); } @@ -108,6 +109,6 @@ void valptridx::null_pointer_exception::report(DXX_VALPTRIDX_REPOR { using namespace untyped_null_pointer_exception; char buf[report_buffer_size]; - prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS static_cast(&array[0]), buf, array.size()); + prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS addressof(array), buf, array.size()); throw null_pointer_exception(buf); }