diff --git a/hipamd/src/program_state.inl b/hipamd/src/program_state.inl index 0442874900..c8eb2f297c 100644 --- a/hipamd/src/program_state.inl +++ b/hipamd/src/program_state.inl @@ -419,7 +419,8 @@ public: decltype(code_readers.second)::iterator it; { std::lock_guard lck{code_readers.first}; - it = code_readers.second.emplace_back(move(file), move(tmp)); + code_readers.second.emplace_back(move(file), move(tmp)); + it = std::prev(code_readers.second.end()); } auto check_hsa_error = [](hsa_status_t s) {