Implement post-MVP features and native stack overflow check (#243)

Implement native thread stack overflow check
Implement post-MVP: Non-trapping float-to-int conversions
Implement post-MVP: Sign-extension operators
Enhance WASM loader checks
This commit is contained in:
wenyongh
2020-04-30 17:52:11 +08:00
committed by GitHub
parent ab4f0c5419
commit d381b0fdec
36 changed files with 1246 additions and 232 deletions

View File

@ -3,6 +3,9 @@
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include "platform_api_vmcore.h"
#include "platform_api_extension.h"
@ -218,3 +221,20 @@ int os_thread_join(korp_tid thread, void **value_ptr)
return pthread_join(thread, value_ptr);
}
uint8 *os_thread_get_stack_boundary()
{
pthread_attr_t attr;
void *addr = NULL;
size_t size;
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
pthread_attr_getstack(&attr, &addr, &size);
pthread_attr_destroy (&attr);
}
if (addr)
return (uint8*)addr + _STACK_SIZE_ADJUSTMENT;
else
return NULL;
}