From a9e46aed6eeae5e3921f425c2f54a688c5130dfc Mon Sep 17 00:00:00 2001 From: Jakub Strzebonski Date: Tue, 5 Oct 2021 22:13:03 +0200 Subject: [PATCH] #1393 fix possible binding references to null pointers --- examples/rdma/rdma_simple_get.cc | 2 +- examples/rdma/rdma_simple_get_direct.cc | 4 ++-- examples/rdma/rdma_simple_put.cc | 4 ++-- examples/rdma/rdma_simple_put_direct.cc | 6 +++--- snippets/minimal-large-send-test.cc | 2 +- src/vt/configs/arguments/args.cc | 2 +- src/vt/group/group_info.impl.h | 2 +- src/vt/group/region/group_shallow_list.cc | 2 +- src/vt/rdmahandle/handle.index.impl.h | 4 ++-- src/vt/rdmahandle/handle.node.impl.h | 4 ++-- src/vt/rdmahandle/sub_handle.impl.h | 10 +++++----- src/vt/topos/index/dense/dense_array.impl.h | 2 +- src/vt/utils/demangle/demangle.cc | 2 +- .../balance/stats_restart_reader.cc | 4 ++-- tests/unit/active/test_active_bcast_put.cc | 2 +- tests/unit/active/test_active_send.cc | 4 ++-- tests/unit/active/test_active_send_put.cc | 2 +- .../test_rdma_collection_handle.extended.cc | 4 ++-- tests/unit/rdma/test_rdma_handle.h | 20 +++++++++---------- .../test_rdma_static_sub_handle.extended.cc | 14 ++++++------- tests/unit/runtime/test_initialization.cc | 6 +++--- 21 files changed, 51 insertions(+), 51 deletions(-) diff --git a/examples/rdma/rdma_simple_get.cc b/examples/rdma/rdma_simple_get.cc index 833a21bc19..6ae5587d49 100644 --- a/examples/rdma/rdma_simple_get.cc +++ b/examples/rdma/rdma_simple_get.cc @@ -86,7 +86,7 @@ static vt::RDMA_GetType test_get_fn( this_node, num_bytes, tag ); return vt::RDMA_GetType{ - &my_data[0] + tag, num_bytes == vt::no_byte ? sizeof(double)*10 : num_bytes + my_data.get() + tag, num_bytes == vt::no_byte ? sizeof(double)*10 : num_bytes }; } diff --git a/examples/rdma/rdma_simple_get_direct.cc b/examples/rdma/rdma_simple_get_direct.cc index 753e8d1b14..ae4a9e00e7 100644 --- a/examples/rdma/rdma_simple_get_direct.cc +++ b/examples/rdma/rdma_simple_get_direct.cc @@ -60,7 +60,7 @@ static void tellHandle(HandleMsg* msg) { fmt::print("{}: handle={}, requesting data\n", this_node, msg->han); int const num_elm = 2; vt::theRDMA()->getTypedDataInfoBuf( - msg->han, &my_data[0], num_elm, vt::no_byte, vt::no_tag, [=]{ + msg->han, my_data.get(), num_elm, vt::no_byte, vt::no_tag, [=]{ for (auto i = 0; i < num_elm; i++) { fmt::print("node {}: \t: my_data[{}] = {}\n", this_node, i, my_data[i]); } @@ -83,7 +83,7 @@ int main(int argc, char** argv) { if (this_node == 0) { vt::RDMA_HandleType my_handle = - vt::theRDMA()->registerNewTypedRdmaHandler(&my_data[0], my_data_len); + vt::theRDMA()->registerNewTypedRdmaHandler(my_data.get(), my_data_len); auto msg = vt::makeMessage(this_node); msg->han = my_handle; diff --git a/examples/rdma/rdma_simple_put.cc b/examples/rdma/rdma_simple_put.cc index e6f8dfdf5b..854e3d11e5 100644 --- a/examples/rdma/rdma_simple_put.cc +++ b/examples/rdma/rdma_simple_put.cc @@ -103,7 +103,7 @@ static void put_handler_fn( fmt::print( "{}: put_handler_fn: my_data={}, in_ptr={}, in_num_bytes={}, tag={}, " "offset={}\n", - this_node, print_ptr(&my_data[0]), print_ptr(in_ptr), in_num_bytes, tag, + this_node, print_ptr(my_data.get()), print_ptr(in_ptr), in_num_bytes, tag, offset ); @@ -115,7 +115,7 @@ static void put_handler_fn( ); } - std::memcpy(&my_data[0] + offset, in_ptr, in_num_bytes); + std::memcpy(my_data.get() + offset, in_ptr, in_num_bytes); } int main(int argc, char** argv) { diff --git a/examples/rdma/rdma_simple_put_direct.cc b/examples/rdma/rdma_simple_put_direct.cc index 8f5fa813a4..7463b0a959 100644 --- a/examples/rdma/rdma_simple_put_direct.cc +++ b/examples/rdma/rdma_simple_put_direct.cc @@ -72,13 +72,13 @@ static void putDataFn(HandleMsg* msg) { if (this_node == 1 or this_node == 2) { fmt::print( "{}: putting data, handle={}, my_data={}\n", - this_node, msg->han, print_ptr(&my_data[0]) + this_node, msg->han, print_ptr(my_data.get()) ); int const num_elm = 2; int const offset = num_elm*(this_node-1); auto han = msg->han; - vt::theRDMA()->putTypedData(msg->han, &my_data[0], num_elm, offset, [=]{ + vt::theRDMA()->putTypedData(msg->han, my_data.get(), num_elm, offset, [=]{ fmt::print( "{}: after put: sending msg back to 0: offset={}\n", this_node, offset ); @@ -108,7 +108,7 @@ int main(int argc, char** argv) { if (this_node == 0) { vt::RDMA_HandleType my_handle = - vt::theRDMA()->registerNewTypedRdmaHandler(&my_data[0], put_len); + vt::theRDMA()->registerNewTypedRdmaHandler(my_data.get(), put_len); fmt::print( "{}: initializing my_handle={}\n", diff --git a/snippets/minimal-large-send-test.cc b/snippets/minimal-large-send-test.cc index f3a1b24c76..1c9bf367f9 100644 --- a/snippets/minimal-large-send-test.cc +++ b/snippets/minimal-large-send-test.cc @@ -58,7 +58,7 @@ int main(int argc, char** argv) { std::vector stats; stats.resize(reqs.size()); - MPI_Waitall(reqs.size(), &reqs[0], &stats[0]); + MPI_Waitall(reqs.size(), reqs.data(), stats.data()); MPI_Finalize(); diff --git a/src/vt/configs/arguments/args.cc b/src/vt/configs/arguments/args.cc index a47865ad16..11a72c5b1e 100644 --- a/src/vt/configs/arguments/args.cc +++ b/src/vt/configs/arguments/args.cc @@ -748,7 +748,7 @@ std::tuple ArgConfig::parseArguments(CLI::App& app, int& argc, // Set them back with all vt (and MPI) arguments elided argc = new_argc; - argv = &new_argv[0]; + argv = new_argv.get(); return std::make_tuple(-1, std::string{}); } diff --git a/src/vt/group/group_info.impl.h b/src/vt/group/group_info.impl.h index e7fd2de706..ba8ca3113b 100644 --- a/src/vt/group/group_info.impl.h +++ b/src/vt/group/group_info.impl.h @@ -187,7 +187,7 @@ template // Create parent region auto region = std::make_unique( - &local_nodes[0], num_children, true + local_nodes.data(), num_children, true ); theGroup()->initializeRemoteGroup( diff --git a/src/vt/group/region/group_shallow_list.cc b/src/vt/group/region/group_shallow_list.cc index a923584db1..c55ca6315d 100644 --- a/src/vt/group/region/group_shallow_list.cc +++ b/src/vt/group/region/group_shallow_list.cc @@ -59,7 +59,7 @@ ShallowList::ShallowList(List const& in_list) { } ShallowList::ShallowList(ListType const& in_list) - : ShallowList(&in_list[0], in_list.size()) + : ShallowList(in_list.data(), in_list.size()) { } /*virtual*/ ShallowList::SizeType ShallowList::getSize() const { diff --git a/src/vt/rdmahandle/handle.index.impl.h b/src/vt/rdmahandle/handle.index.impl.h index eef33687f0..1fbf6072c7 100644 --- a/src/vt/rdmahandle/handle.index.impl.h +++ b/src/vt/rdmahandle/handle.index.impl.h @@ -160,11 +160,11 @@ Handle< if (this->getBuffer() == nullptr) { auto ptr = std::make_unique(len); auto r = proxy.get()->rget( - index, l, &ptr[0], len, offset + this->hoff() + index, l, ptr.get(), len, offset + this->hoff() ); r.addAction([cptr=std::move(ptr),actions=this->actions_]{ for (auto&& action : actions) { - action(&cptr[0]); + action(cptr.get()); } }); return r; diff --git a/src/vt/rdmahandle/handle.node.impl.h b/src/vt/rdmahandle/handle.node.impl.h index 1fcd8c35d9..702552a755 100644 --- a/src/vt/rdmahandle/handle.node.impl.h +++ b/src/vt/rdmahandle/handle.node.impl.h @@ -95,11 +95,11 @@ Handle< if (this->getBuffer() == nullptr) { auto ptr = std::make_unique(len); auto r = vt::theHandleRDMA()->getEntry(key_).rget( - node, l, &ptr[0], len, offset + this->hoff() + node, l, ptr.get(), len, offset + this->hoff() ); r.addAction([cptr=std::move(ptr),actions=this->actions_]{ for (auto&& action : actions) { - action(&cptr[0]); + action(cptr.get()); } }); return r; diff --git a/src/vt/rdmahandle/sub_handle.impl.h b/src/vt/rdmahandle/sub_handle.impl.h index 8799df18f5..e419f2bb97 100644 --- a/src/vt/rdmahandle/sub_handle.impl.h +++ b/src/vt/rdmahandle/sub_handle.impl.h @@ -210,7 +210,7 @@ void SubHandle::updateInfo( auto ptr = std::make_unique(home_size); // These can probably be relaxed to Shared locks because lin_idx is never // modified - loc_handle_.get(home, &ptr[0], home_size, 0, Lock::Exclusive); + loc_handle_.get(home, ptr.get(), home_size, 0, Lock::Exclusive); for (uint64_t i = 0; i < home_size; i += 4) { vt_debug_print( verbose, rdma, @@ -229,7 +229,7 @@ void SubHandle::updateInfo( auto pptr = std::make_unique(2); pptr[0] = info.getOffset(); pptr[1] = info.getNode(); - loc_handle_.put(home, &pptr[0], 2, offset + 1, Lock::Exclusive); + loc_handle_.put(home, pptr.get(), 2, offset + 1, Lock::Exclusive); } } } @@ -242,7 +242,7 @@ IndexInfo SubHandle::fetchInfo(IndexT const& idx) { auto offset = getOrderedOffset(idx, home_node); if (not is_migratable_) { auto ptr = std::make_unique(4); - loc_handle_.get(home_node, &ptr[0], 4, offset*2, Lock::Exclusive); + loc_handle_.get(home_node, ptr.get(), 4, offset*2, Lock::Exclusive); auto lin_idx = linearize(idx); vt_debug_print( verbose, rdma, @@ -254,7 +254,7 @@ IndexInfo SubHandle::fetchInfo(IndexT const& idx) { return IndexInfo(home_node, ptr[1], ptr[3]-ptr[1]); } else { auto ptr = std::make_unique(4); - loc_handle_.get(home_node, &ptr[0], 4, offset*4, Lock::Exclusive); + loc_handle_.get(home_node, ptr.get(), 4, offset*4, Lock::Exclusive); auto lin_idx = linearize(idx); vt_debug_print( verbose, rdma, @@ -274,7 +274,7 @@ IndexInfo SubHandle::fetchInfo(IndexT const& idx) { ); auto lin_idx = linearize(idx); auto ptr = std::make_unique(home_size); - loc_handle_.get(home_node, &ptr[0], home_size, 0, Lock::Exclusive); + loc_handle_.get(home_node, ptr.get(), home_size, 0, Lock::Exclusive); if (not is_migratable_) { for (uint64_t i = 0; i < home_size; i += 2) { vt_debug_print( diff --git a/src/vt/topos/index/dense/dense_array.impl.h b/src/vt/topos/index/dense/dense_array.impl.h index 424653905d..0f8879b038 100644 --- a/src/vt/topos/index/dense/dense_array.impl.h +++ b/src/vt/topos/index/dense/dense_array.impl.h @@ -194,7 +194,7 @@ bool DenseIndexArray::operator==( template IndexType const* DenseIndexArray::raw() const { - return &dims[0]; + return dims.data(); } template diff --git a/src/vt/utils/demangle/demangle.cc b/src/vt/utils/demangle/demangle.cc index f5a9178584..d53e37c2a1 100644 --- a/src/vt/utils/demangle/demangle.cc +++ b/src/vt/utils/demangle/demangle.cc @@ -203,7 +203,7 @@ DemanglerUtils::join( ) { std::string s; for (std::string const& i : strs) { - if (&i != &strs[0]) { + if (&i != strs.data()) { s += delim; } s += i; diff --git a/src/vt/vrt/collection/balance/stats_restart_reader.cc b/src/vt/vrt/collection/balance/stats_restart_reader.cc index be5b27f92e..55e98f8f27 100644 --- a/src/vt/vrt/collection/balance/stats_restart_reader.cc +++ b/src/vt/vrt/collection/balance/stats_restart_reader.cc @@ -270,7 +270,7 @@ void StatsRestartReader::gatherMsgs(VecMsg *msg) { proc_phase_runs_LB_[phaseID] = (!migrate.empty()); auto& myList = proc_move_list_[phaseID]; myList.resize(toMove.size() - header); - std::copy(&toMove[header], &toMove[0] + toMove.size(), + std::copy(&toMove[header], toMove.data() + toMove.size(), myList.begin()); } } @@ -293,7 +293,7 @@ void StatsRestartReader::scatterMsgs(VecMsg *msg) { } //--- Copy the migration information myList.resize(recvVec.size() - header); - std::copy(&recvVec[header], &recvVec[0]+recvVec.size(), myList.begin()); + std::copy(&recvVec[header], recvVec.data()+recvVec.size(), myList.begin()); } }}}} /* end namespace vt::vrt::collection::balance */ diff --git a/tests/unit/active/test_active_bcast_put.cc b/tests/unit/active/test_active_bcast_put.cc index ee5301316c..78a6ba4e21 100644 --- a/tests/unit/active/test_active_bcast_put.cc +++ b/tests/unit/active/test_active_bcast_put.cc @@ -126,7 +126,7 @@ TEST_P(TestActiveBroadcastPut, test_type_safe_active_fn_bcast2) { if (my_node == root) { for (int i = 0; i < num_msg_sent; i++) { auto msg = makeMessage(); - msg->setPut(&put_payload[0], put_size * sizeof(int)); + msg->setPut(put_payload.data(), put_size * sizeof(int)); theMsg()->broadcastMsg(msg); } } diff --git a/tests/unit/active/test_active_send.cc b/tests/unit/active/test_active_send.cc index 2b2a6ad46d..f996b6b33f 100644 --- a/tests/unit/active/test_active_send.cc +++ b/tests/unit/active/test_active_send.cc @@ -190,7 +190,7 @@ TEST_F(TestActiveSend, test_type_safe_active_fn_send_small_put) { if (my_node == from_node) { for (int i = 0; i < num_msg_sent; i++) { auto msg = makeMessage(); - msg->setPut(&test_vec[0], sizeof(int)*test_vec.size()); + msg->setPut(test_vec.data(), sizeof(int)*test_vec.size()); #if DEBUG_TEST_HARNESS_PRINT fmt::print("{}: sendMsg: (put) i={}\n", my_node, i); #endif @@ -215,7 +215,7 @@ TEST_F(TestActiveSend, test_type_safe_active_fn_send_large_put) { if (my_node == from_node) { for (int i = 0; i < num_msg_sent; i++) { auto msg = makeMessage(); - msg->setPut(&test_vec_2[0], sizeof(int)*test_vec_2.size()); + msg->setPut(test_vec_2.data(), sizeof(int)*test_vec_2.size()); #if DEBUG_TEST_HARNESS_PRINT fmt::print("{}: sendMsg: (put) i={}\n", my_node, i); #endif diff --git a/tests/unit/active/test_active_send_put.cc b/tests/unit/active/test_active_send_put.cc index c411d8278d..8cf89320f7 100644 --- a/tests/unit/active/test_active_send_put.cc +++ b/tests/unit/active/test_active_send_put.cc @@ -109,7 +109,7 @@ TEST_P(TestActiveSendPut, test_active_fn_send_put_param) { auto msg = makeMessage( static_cast(test_vec_2.size()) ); - msg->setPut(&test_vec_2[0], sizeof(int)*test_vec_2.size()); + msg->setPut(test_vec_2.data(), sizeof(int)*test_vec_2.size()); #if DEBUG_TEST_HARNESS_PRINT fmt::print("{}: sendMsg: (put) i={}\n", my_node, i); #endif diff --git a/tests/unit/rdma/test_rdma_collection_handle.extended.cc b/tests/unit/rdma/test_rdma_collection_handle.extended.cc index 8b8b832a53..ac96cdfc0f 100644 --- a/tests/unit/rdma/test_rdma_collection_handle.extended.cc +++ b/tests/unit/rdma/test_rdma_collection_handle.extended.cc @@ -77,7 +77,7 @@ struct TestCol : vt::Collection, vt::Index2D> { auto next_x = idx.x() + 1 < 8 ? idx.x() + 1 : 0; vt::Index2D next(next_x, idx.y()); auto ptr = std::make_unique(8); - handle_.get(next, &ptr[0], 8, 0, vt::Lock::Shared); + handle_.get(next, ptr.get(), 8, 0, vt::Lock::Shared); for (int i = 0; i < 8; i++) { EXPECT_EQ(ptr[i], next_x * 100 + idx.y()); } @@ -106,7 +106,7 @@ struct TestCol : vt::Collection, vt::Index2D> { auto next_x = idx.x() + 1 < 8 ? idx.x() + 1 : 0; vt::Index2D next(next_x, idx.y()); auto ptr = std::make_unique(8); - handle_.get(next, &ptr[0], 8, 0, vt::Lock::Shared); + handle_.get(next, ptr.get(), 8, 0, vt::Lock::Shared); for (int i = 0; i < 8; i++) { EXPECT_EQ(ptr[i], next_x * 100 + idx.y()); } diff --git a/tests/unit/rdma/test_rdma_handle.h b/tests/unit/rdma/test_rdma_handle.h index 519528e0b7..4e3647ebb0 100644 --- a/tests/unit/rdma/test_rdma_handle.h +++ b/tests/unit/rdma/test_rdma_handle.h @@ -101,18 +101,18 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_1) { for (vt::NodeType node = 0; node < num; node++) { { auto ptr = std::make_unique(size); - handle.get(node, &ptr[0], size, 0, vt::Lock::Shared); + handle.get(node, ptr.get(), size, 0, vt::Lock::Shared); UpdateData::test(std::move(ptr), space, size, node, 0); } { auto ptr = std::make_unique(size/2); - auto req = handle.rget(node, &ptr[0], size/2, size/2, vt::Lock::Shared); + auto req = handle.rget(node, ptr.get(), size/2, size/2, vt::Lock::Shared); req.wait(); UpdateData::test(std::move(ptr), space, size/2, node, size/2); } { auto ptr = std::make_unique(1); - handle.get(node, &ptr[0], 1, size-1, vt::Lock::Shared); + handle.get(node, ptr.get(), 1, size-1, vt::Lock::Shared); UpdateData::test(std::move(ptr), space, 1, node, size-1); } } @@ -144,7 +144,7 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_2) { for (vt::NodeType node = 0; node < num; node++) { { auto ptr = std::make_unique(size); - handle.get(node, &ptr[0], size, 0, vt::Lock::Shared); + handle.get(node, ptr.get(), size, 0, vt::Lock::Shared); UpdateData::test(std::move(ptr), space, size, node, 0); } } @@ -154,8 +154,8 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_2) { { auto ptr = std::make_unique(size/2); - UpdateData::setMem(&ptr[0], space, size/2, rank, size/2); - handle.put(next, &ptr[0], size/2, size/2, vt::Lock::Exclusive); + UpdateData::setMem(ptr.get(), space, size/2, rank, size/2); + handle.put(next, ptr.get(), size/2, size/2, vt::Lock::Exclusive); } // Barrier to allow puts to finish @@ -164,7 +164,7 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_2) { { auto ptr = std::make_unique(size); auto ptr2 = std::make_unique(size); - handle.get(next, &ptr[0], size, 0, vt::Lock::Shared); + handle.get(next, ptr.get(), size, 0, vt::Lock::Shared); for (std::size_t i = 0; i < size; i++) { ptr2[i] = ptr[i]; } @@ -198,7 +198,7 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_3) { for (std::size_t i = 0; i < size; i++) { ptr[i] = static_cast(1); } - handle.accum(node, &ptr[0], size, 0, MPI_SUM, vt::Lock::Shared); + handle.accum(node, ptr.get(), size, 0, MPI_SUM, vt::Lock::Shared); } } @@ -208,7 +208,7 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_3) { for (vt::NodeType node = 0; node < num; node++) { { auto ptr = std::make_unique(size); - handle.get(node, &ptr[0], size, 0, vt::Lock::Exclusive); + handle.get(node, ptr.get(), size, 0, vt::Lock::Exclusive); UpdateData::test(std::move(ptr), space, size, 0, 0, num); } } @@ -268,7 +268,7 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_5) { for (vt::NodeType node = 0; node < num; node++) { { auto ptr = std::make_unique(size); - handle.get(node, &ptr[0], size, 0, vt::Lock::Exclusive); + handle.get(node, ptr.get(), size, 0, vt::Lock::Exclusive); UpdateData::test(std::move(ptr), space, size, 0, node, num); } } diff --git a/tests/unit/rdma/test_rdma_static_sub_handle.extended.cc b/tests/unit/rdma/test_rdma_static_sub_handle.extended.cc index fcfce432cf..2d0da7ca2d 100644 --- a/tests/unit/rdma/test_rdma_static_sub_handle.extended.cc +++ b/tests/unit/rdma/test_rdma_static_sub_handle.extended.cc @@ -119,7 +119,7 @@ TYPED_TEST_P(TestRDMAHandleSet, test_rdma_handle_set_1) { auto idx_rank = node * num_hans + han; vt::Index2D idx(node, han); auto ptr = std::make_unique(num_vals); - han_set->get(idx, &ptr[0], num_vals, 0, vt::Lock::Shared); + han_set->get(idx, ptr.get(), num_vals, 0, vt::Lock::Shared); UpdateData::test(std::move(ptr), space, num_vals, idx_rank, 0); } } @@ -164,7 +164,7 @@ TYPED_TEST_P(TestRDMAHandleSet, test_rdma_handle_set_2) { auto idx_rank = node * max_hans + han; auto ptr = std::make_unique(count); - han_set->get(idx, &ptr[0], count, 0, vt::Lock::Shared); + han_set->get(idx, ptr.get(), count, 0, vt::Lock::Shared); UpdateData::test(std::move(ptr), space, count, idx_rank, 0); } } @@ -245,7 +245,7 @@ TYPED_TEST_P(TestRDMAHandleSet, test_rdma_handle_set_3) { auto idx_rank = node * num_hans + han; auto ptr = std::make_unique(size); - auto req = han_set->rget(idx, &ptr[0], size, 0, vt::Lock::Exclusive); + auto req = han_set->rget(idx, ptr.get(), size, 0, vt::Lock::Exclusive); req.wait(); UpdateData::test(std::move(ptr), space, size, idx_rank, 0, num_nodes); } @@ -286,8 +286,8 @@ TYPED_TEST_P(TestRDMAHandleSet, test_rdma_handle_set_4) { vt::Index2D idx(next, han); auto ptr = std::make_unique(num_vals/2); auto idx_rank = this_node * num_hans + han; - UpdateData::setMem(&ptr[0], space, num_vals/2, idx_rank, num_vals/2); - han_set->put(idx, &ptr[0], num_vals/2, num_vals/2, vt::Lock::Exclusive); + UpdateData::setMem(ptr.get(), space, num_vals/2, idx_rank, num_vals/2); + han_set->put(idx, ptr.get(), num_vals/2, num_vals/2, vt::Lock::Exclusive); } // Barrier to order following locks @@ -297,7 +297,7 @@ TYPED_TEST_P(TestRDMAHandleSet, test_rdma_handle_set_4) { vt::Index2D idx(next, han); auto ptr = std::make_unique(num_vals); auto ptr2 = std::make_unique(num_vals); - han_set->get(idx, &ptr[0], num_vals, 0, vt::Lock::Shared); + han_set->get(idx, ptr.get(), num_vals, 0, vt::Lock::Shared); for (std::size_t i = 0; i < num_vals; i++) { ptr2[i] = ptr[i]; } @@ -353,7 +353,7 @@ TYPED_TEST_P(TestRDMAHandleSet, test_rdma_handle_set_5) { vt::Index2D idx(node, han); auto idx_rank = node * num_hans + han; auto ptr = std::make_unique(num_vals); - han_set->get(idx, &ptr[0], num_vals, 0, vt::Lock::Exclusive); + han_set->get(idx, ptr.get(), num_vals, 0, vt::Lock::Exclusive); UpdateData::test(std::move(ptr), space, num_vals, idx_rank, 0, num_nodes); } } diff --git a/tests/unit/runtime/test_initialization.cc b/tests/unit/runtime/test_initialization.cc index 0feb518183..d47fb7afb5 100644 --- a/tests/unit/runtime/test_initialization.cc +++ b/tests/unit/runtime/test_initialization.cc @@ -61,9 +61,9 @@ struct TestInitialization : TestParallelHarness { static char prog_name[]{"vt_program"}; static char cli_argument[]{"--cli_argument=100"}; static char vt_no_terminate[]{"--vt_no_terminate"}; - custom_args.emplace_back(&prog_name[0]); - custom_args.emplace_back(&cli_argument[0]); - custom_args.emplace_back(&vt_no_terminate[0]); + custom_args.emplace_back(prog_name); + custom_args.emplace_back(cli_argument); + custom_args.emplace_back(vt_no_terminate); custom_args.emplace_back(nullptr); custom_argc = custom_args.size() - 1;