We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee97e30 commit fd01e6fCopy full SHA for fd01e6f
core/shared/platform/common/posix/posix_thread.c
@@ -326,10 +326,16 @@ os_thread_get_stack_boundary()
326
#elif defined(__APPLE__) || defined(__NuttX__)
327
if ((addr = (uint8 *)pthread_get_stackaddr_np(self))) {
328
stack_size = pthread_get_stacksize_np(self);
329
+
330
+ /* Check whether stack_addr is the base or end of the stack,
331
+ change it to the base if it is the end of stack */
332
+ if (addr <= (uint8 *)&stack_size)
333
+ addr = addr + stack_size;
334
335
if (stack_size > max_stack_size)
- addr -= max_stack_size;
- else
- addr -= stack_size;
336
+ stack_size = max_stack_size;
337
338
+ addr -= stack_size;
339
/* Reserved 1 guard page at least for safety */
340
addr += page_size;
341
}
0 commit comments