Update assert for WASM

This commit is contained in:
Christoffer Lerno
2021-12-20 00:32:27 +01:00
parent 4575e3dd8d
commit 04c3efc3c3

View File

@@ -1099,7 +1099,9 @@ void llvm_emit_debug_output(GenContext *c, const char *message, const char *file
int line_index;
int expr_index;
int func_index = -1;
switch (platform_target.os)
OsType os = platform_target.os;
if (platform_target.arch == WASM32 || platform_target.arch == WASM64) os = OS_TYPE_WASI;
switch (os)
{
case OS_TYPE_WIN32:
name = "_assert";
@@ -1122,6 +1124,7 @@ void llvm_emit_debug_output(GenContext *c, const char *message, const char *file
func_index = 3;
break;
case OS_TYPE_LINUX:
case OS_TYPE_WASI:
name = "__assert_fail";
expr_index = 0;
file_index = 1;
@@ -1157,6 +1160,7 @@ void llvm_emit_debug_output(GenContext *c, const char *message, const char *file
break;
}
case OS_DARWIN_TYPES:
case OS_TYPE_WASI:
case OS_TYPE_LINUX:
case OS_TYPE_SOLARIS:
{