Skip to content

Commit 6881828

Browse files
committed
[emscripten] libscript: Use double alignment for foreign invoke storage
1 parent b4373d5 commit 6881828

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libscript/src/script-instance.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ class __MCScriptStackStorage
7979
size_t m_used;
8080
};
8181

82+
#if defined(__EMSCRIPTEN__)
83+
/* On emscripten, we require double alignment */
84+
typedef __MCScriptStackStorage<double,32> MCScriptStackStorage;
85+
86+
#else
87+
typedef __MCScriptStackStorage<void *,32> MCScriptStackStorage;
88+
89+
#endif
90+
8291
////////////////////////////////////////////////////////////////////////////////
8392

8493
// This is the module of the most recent LCB stack frame on the current thread's
@@ -1222,7 +1231,7 @@ static bool MCScriptPerformForeignInvoke(MCScriptFrame*& x_frame, MCScriptInstan
12221231
void *t_args[16];
12231232
ffi_type *t_arg_types[16];
12241233
bool t_arg_new[16];
1225-
__MCScriptStackStorage<void *,32> t_invoke_storage;
1234+
MCScriptStackStorage t_invoke_storage;
12261235

12271236
uindex_t t_arg_index;
12281237
t_arg_index = 0;

0 commit comments

Comments
 (0)