Skip to content

Commit eaacaf2

Browse files
gaojiaqi7jyao1
authored andcommittedDec 26, 2024
td-exception: fix interrupt handler condition
The compiler may perform a circular right shift, resulting in incorrect assembly code for interrupt vectors greater than 64. Unconditionally push an error code of 0 for interrupt vectors greater than 31, as the CPU does not save an error code for these interrupts. Signed-off-by: Jiaqi Gao <[email protected]>

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎td-exception/src/asm/handler.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ interrupt_handler_table:
5252
i = 0
5353
.rept 256
5454
.align 32
55-
.if ((EXCEPTION_ERROR_CODE_MASK >> i) & 1) == 0
55+
.if i > 31 || ((EXCEPTION_ERROR_CODE_MASK >> i) & 1) == 0
5656
push 0
5757
.endif
5858
push i

0 commit comments

Comments
 (0)
Please sign in to comment.