gdbstub: fixed build-error due to potentially uninitialized variable on -O2

Closes https://github.com/espressif/esp-idf/issues/9706
pull/9732/head
Marius Vikhammer 2022-09-05 10:55:29 +08:00
rodzic 0637ea91a3
commit f4a220b3f9
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -847,7 +847,7 @@ static bool get_task_handle(size_t index, TaskHandle_t *handle)
static eTaskState get_task_state(size_t index)
{
eTaskState result = eReady;
TaskHandle_t handle;
TaskHandle_t handle = NULL;
get_task_handle(index, &handle);
if (gdb_debug_int == false) {
result = eTaskGetState(handle);
@ -858,7 +858,9 @@ static eTaskState get_task_state(size_t index)
static int get_task_cpu_id(size_t index)
{
TaskHandle_t handle;
get_task_handle(index, &handle);
if (!get_task_handle(index, &handle)) {
return -1;
}
BaseType_t core_id = xTaskGetAffinity(handle);
return (int)core_id;
}