You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "sandbox_types.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Takes the arguments from the sandbox struct and writes them into the WebAssembly linear memory
|
|
|
|
*/
|
|
|
|
static inline void
|
|
|
|
sandbox_setup_arguments(struct sandbox *sandbox)
|
|
|
|
{
|
|
|
|
assert(sandbox != NULL);
|
|
|
|
int32_t argument_count = 0;
|
|
|
|
/* whatever gregor has, to be able to pass arguments to a module! */
|
|
|
|
sandbox->arguments_offset = local_sandbox_context_cache.memory.size;
|
|
|
|
assert(local_sandbox_context_cache.memory.start == sandbox->memory.start);
|
|
|
|
expand_memory();
|
|
|
|
|
|
|
|
int32_t string_off = sandbox->arguments_offset;
|
|
|
|
|
|
|
|
stub_init(string_off);
|
|
|
|
}
|