mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
gdbstub: fixed build-error due to potentially uninitialized variable on -O2
Closes https://github.com/espressif/esp-idf/issues/9706
This commit is contained in:
parent
4bcf814855
commit
35a2844d6c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user