Skip to content

Commit 1bbf16c

Browse files
committed
fix(esp_system): fix potential warnings related to array size in .eh_frame parser
1 parent 4483e26 commit 1bbf16c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

components/esp_system/eh_frame_parser.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -150,7 +150,7 @@ typedef struct {
150150

151151
/**
152152
* @brief Set a register's offset (relative to CFA).
153-
* The highest bit is set to 1 to mark that this register needs to be retrived because it has been
153+
* The highest bit is set to 1 to mark that this register needs to be retrieved because it has been
154154
* altered.
155155
*/
156156
#define ESP_EH_FRAME_SET_REG_OFFSET(offset) (0x80000000 | offset)
@@ -201,7 +201,7 @@ typedef struct {
201201
#define ESP_EH_FRAME_GET_CFA_OFF(value) ((value) >> 8)
202202

203203
/**
204-
* @brief Unsupported opcode value to return when exeucting 0-opcode type instructions.
204+
* @brief Unsupported opcode value to return when executing 0-opcode type instructions.
205205
*/
206206
#define ESP_EH_FRAME_UNSUPPORTED_OPCODE ((uint32_t) -1)
207207

@@ -253,8 +253,8 @@ typedef struct {
253253
* @brief Symbols defined by the linker.
254254
* Retrieve the addresses of both .eh_frame_hdr and .eh_frame sections.
255255
*/
256-
extern void *__eh_frame_hdr;
257-
extern void *__eh_frame;
256+
extern uint8_t __eh_frame_hdr[];
257+
extern uint8_t __eh_frame[];
258258

259259
/**
260260
* @brief Decode multiple bytes encoded in LEB128.
@@ -727,7 +727,7 @@ static uint32_t esp_eh_frame_initialize_state(const uint8_t* cie, ExecutionFrame
727727
* @param state DWARF VM registers.
728728
*
729729
* @return Return Address of the current context. Frame has been restored to the previous context
730-
* (before calling the function program counter is currently going throught).
730+
* (before calling the function program counter is currently going through).
731731
*/
732732
static uint32_t esp_eh_frame_restore_caller_state(const uint32_t* fde,
733733
ExecutionFrame* frame,
@@ -768,7 +768,7 @@ static uint32_t esp_eh_frame_restore_caller_state(const uint32_t* fde,
768768
*/
769769
bool success = esp_eh_frame_execute(instructions, instructions_length, frame, state);
770770
if (!success) {
771-
/* An error occured (unsupported opcode), return PC as the return address.
771+
/* An error occurred (unsupported opcode), return PC as the return address.
772772
* This will be tested by the caller, and the backtrace will be finished. */
773773
return EXECUTION_FRAME_PC(*frame);
774774
}
@@ -799,7 +799,7 @@ static uint32_t esp_eh_frame_restore_caller_state(const uint32_t* fde,
799799
/* If the frame was not available, it would be possible to retrieve the return address
800800
* register thanks to CIE structure.
801801
* The return address points to the address the PC needs to jump to. It
802-
* does NOT point to the instruction where the routine call occured.
802+
* does NOT point to the instruction where the routine call occurred.
803803
* This can cause problems with functions without epilogue (i.e. function
804804
* which last instruction is a function call). This happens when compiler
805805
* optimization are ON or when a function is marked as "noreturn".
@@ -840,7 +840,7 @@ static bool esp_eh_frame_missing_info(const uint32_t* fde, uint32_t pc)
840840

841841
/**
842842
* @brief When one step of the backtrace is generated, output it to the serial.
843-
* This function can be overriden as it is defined as weak.
843+
* This function can be overridden as it is defined as weak.
844844
*
845845
* @param pc Program counter of the backtrace step.
846846
* @param sp Stack pointer of the backtrace step.

0 commit comments

Comments
 (0)