Skip to content

Commit f175b37

Browse files
committed
add temporary wasm buffer to instance
1 parent 05b3f76 commit f175b37

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sources/include/cage-core/wasm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ namespace cage
232232
{
233233
public:
234234
WasmFunction() = default;
235-
//WasmFunction(WasmFunction &&) = default;
236-
//WasmFunction &operator=(WasmFunction &&) = default;
237235

238236
explicit WasmFunction(Holder<privat::WasmFunctionInternal> &&func_) : func(std::move(func_))
239237
{
@@ -305,6 +303,8 @@ namespace cage
305303
return WasmFunction<T>(function_(name));
306304
}
307305

306+
WasmBuffer temporary; // use for passing data in function calls
307+
308308
private:
309309
Holder<privat::WasmFunctionInternal> function_(const WasmName &name);
310310
};

sources/libcore/wasm.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ namespace cage
193193
if (!instance)
194194
{
195195
err.rawLength() = std::strlen(err.rawData());
196-
CAGE_LOG_CONTINUE(SeverityEnum::Note, "wasm", err);
196+
CAGE_LOG_THROW(err);
197197
CAGE_THROW_ERROR(Exception, "failed instantiating wasm module");
198198
}
199199
exec = wasm_runtime_get_exec_env_singleton(instance);
@@ -204,6 +204,7 @@ namespace cage
204204

205205
~WasmInstanceImpl()
206206
{
207+
temporary = {};
207208
if (instance)
208209
{
209210
wasm_runtime_deinstantiate(instance);

0 commit comments

Comments
 (0)