sim: fix sim runtime err under sanitize check mode.

since gcc sanitize can not stub proper code in nuttx kernel code.
This commit is contained in:
mage1 2021-03-17 15:41:18 +08:00 committed by Abdelatif Guettouche
parent 2d4906ab9b
commit c82a676630

View File

@ -26,6 +26,9 @@
#include <stdint.h>
#include <string.h>
#ifdef CONFIG_SIM_ASAN
#include <sanitizer/asan_interface.h>
#endif
#include <nuttx/arch.h>
@ -83,4 +86,7 @@ void up_initial_state(struct tcb_s *tcb)
tcb->adj_stack_size -
sizeof(xcpt_reg_t);
tcb->xcp.regs[JB_PC] = (xcpt_reg_t)tcb->start;
#ifdef CONFIG_SIM_ASAN
__asan_unpoison_memory_region(tcb->stack_alloc_ptr, tcb->adj_stack_size);
#endif
}