Check for an empty vector before popping (#350)

Protect from possible seg. fault

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

[ROCm/rocprofiler-systems commit: 59e7b4b501]
Tento commit je obsažen v:
David Galiffi
2024-06-19 14:59:23 -04:00
odevzdal GitHub
rodič a8595dc524
revize 648edf3820
+5 -2
Zobrazit soubor
@@ -526,8 +526,11 @@ profiler_function(py::object pframe, const char* swhat, py::object arg)
// stop function
auto _profiler_return = [&]() {
_config.records.back()();
_config.records.pop_back();
if(!_config.records.empty())
{
_config.records.back()();
_config.records.pop_back();
}
};
// process what