Fix a SEGV when running --roctx-trace

There's a typo in RegisterApiCallback, roctx::cb_table.Get should be
roctx::cb_table.Set.

Change-Id: I47ec8ac666f783ff4e03f35d13e375e645899900
Cette révision appartient à :
Laurent Morichetti a créé et Laurent Morichetti a révisé 2022-04-27 12:14:32 -04:00
1 Parent 7f05496a87
révision 0d7d56eea5
2 fichiers modifiés
+2 -1

Aucun fichier ne correspond à votre recherche

+1
Voir le fichier
@@ -45,6 +45,7 @@ template <uint32_t N> class CallbackTable {
void Get(uint32_t id, activity_rtapi_callback_t* callback, void** arg) const {
assert(id < N && "id is out of range");
assert(callback != nullptr && arg != nullptr && "invalid arguments");
std::lock_guard lock(mutex_);
std::tie(*callback, *arg) = callbacks_[id];
}
+1 -1
Voir le fichier
@@ -230,7 +230,7 @@ PUBLIC_API bool RegisterApiCallback(uint32_t op, void* callback, void* arg) {
PUBLIC_API bool RemoveApiCallback(uint32_t op) {
if (op >= ROCTX_API_ID_NUMBER) return false;
roctx::cb_table.Get(op, NULL, NULL);
roctx::cb_table.Set(op, nullptr, nullptr);
return true;
}