mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
Add check for stack_min_addr in bound check with hardware trap (#1166)
Add return value check for os_thread_get_stack_boundary before touch_pages in the initialization of memory access bound check with hardware trap.
This commit is contained in:
parent
3d1dad7792
commit
0993601d55
|
@ -411,6 +411,9 @@ init_stack_guard_pages()
|
|||
uint32 guard_page_count = STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT;
|
||||
uint8 *stack_min_addr = os_thread_get_stack_boundary();
|
||||
|
||||
if (stack_min_addr == NULL)
|
||||
return false;
|
||||
|
||||
/* Touch each stack page to ensure that it has been mapped: the OS
|
||||
may lazily grow the stack mapping as a guard page is hit. */
|
||||
(void)touch_pages(stack_min_addr, page_size);
|
||||
|
|
Loading…
Reference in New Issue
Block a user