From 565dbac2d48839ce2c32f895afc701d7120faa1a Mon Sep 17 00:00:00 2001 From: "Shweta.Khatri" Date: Fri, 22 Mar 2024 23:55:42 -0400 Subject: [PATCH] Replace lazy_ptr's Init() with reset() method The function Init() called by one of the constructors of lazy_ptr is undefined. Replacing with reset method sets the object to an uninitialized state and assigns a new constructor function Fix submitted on github by zhoumin2 - https://github.com/ROCm/ROCR-Runtime/pull/184 Change-Id: I7d906d526ce7fe7e2548b01810e6395b13497bf3 [ROCm/ROCR-Runtime commit: 00b63f7452a5514ef8e884199905084a83e8a04e] --- projects/rocr-runtime/runtime/hsa-runtime/core/util/lazy_ptr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/lazy_ptr.h b/projects/rocr-runtime/runtime/hsa-runtime/core/util/lazy_ptr.h index e2a847b5c4..2aef6a3bf3 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/lazy_ptr.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/lazy_ptr.h @@ -59,7 +59,7 @@ template class lazy_ptr { public: lazy_ptr() {} - explicit lazy_ptr(std::function Constructor) { Init(Constructor); } + explicit lazy_ptr(std::function Constructor) { reset(Constructor); } lazy_ptr(lazy_ptr&& rhs) { obj = std::move(rhs.obj);