Refine aot stack overflow check and enhance wasm loader malformed checks (#248)

And separate global data from wasm memory instance
This commit is contained in:
wenyongh
2020-05-08 12:38:59 +08:00
committed by GitHub
parent d381b0fdec
commit e8e45aeecd
16 changed files with 241 additions and 162 deletions

View File

@ -33,17 +33,12 @@ typedef struct WASMMemoryInstance {
/* Memory data */
uint8 *memory_data;
/* Global data of global instances */
uint8 *global_data;
uint32 global_data_size;
/* End address of memory */
uint8 *end_addr;
/* Base address, the layout is:
heap_data + memory data + global data
heap_data + memory data
memory data init size is: num_bytes_per_page * cur_page_count
global data size is calculated in module instantiating
Note: when memory is re-allocated, the heap data and memory data
must be copied to new memory also.
*/
@ -127,6 +122,8 @@ typedef struct WASMModuleInstance {
WASMMemoryInstance *default_memory;
WASMTableInstance *default_table;
/* Global data of global instances */
uint8 *global_data;
WASMFunctionInstance *start_function;