This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new eb722794b5 arch/x86_64:Fix variable used before assignment
eb722794b5 is described below

commit eb722794b56caf3512b64af945d7a920ecfae3bd
Author: liwenxiang1 <[email protected]>
AuthorDate: Wed Oct 23 13:51:13 2024 +0800

    arch/x86_64:Fix variable used before assignment
    
    Signed-off-by: liwenxiang1 <[email protected]>
---
 arch/x86_64/src/intel64/intel64_handlers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86_64/src/intel64/intel64_handlers.c 
b/arch/x86_64/src/intel64/intel64_handlers.c
index 754b6f4d00..c17f8fc8c2 100644
--- a/arch/x86_64/src/intel64/intel64_handlers.c
+++ b/arch/x86_64/src/intel64/intel64_handlers.c
@@ -98,6 +98,7 @@ static uint64_t *common_handler(int irq, uint64_t *regs)
 
       /* Update scheduler parameters */
 
+      cpu = this_cpu();
       nxsched_suspend_scheduler(g_running_tasks[cpu]);
       nxsched_resume_scheduler(this_task());
 
@@ -106,7 +107,6 @@ static uint64_t *common_handler(int irq, uint64_t *regs)
        * crashes.
        */
 
-      cpu = this_cpu();
       tcb = current_task(cpu);
       g_running_tasks[cpu] = tcb;
 

Reply via email to