Fixed #20
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 12 Sep 2020 18:36:46 +0000 (13:36 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 12 Sep 2020 18:36:46 +0000 (13:36 -0500)
onyx
progs/particle_sym.onyx
src/onyxchecker.c
src/onyxwasm.c

diff --git a/onyx b/onyx
index 699262fdd4567660c9ca64759bef91c7d2ba2382..f33dd0bb0f1c23c96560b2baf2008069106b3f98 100755 (executable)
Binary files a/onyx and b/onyx differ
index c694db3827fa911b1ae038a5ace40a236f0e3eb1..87ca48f1ca06e2f2731162fe7da2fb7b4b99c8b4 100644 (file)
@@ -34,7 +34,7 @@ init_positions :: proc () {
 }
 
 init_velocities :: proc () {
-    for ^v: velocities do *v = f32x4_const(0.0f, 0.0f, 0.0f, 0.0f);
+    for ^v: velocities do *v = f32x4_splat(0.0f);
 }
 
 horizontal_add :: proc (f: f32x4) -> f32 {
index 98cf5d9a5dd818b41e078e413e88b8d5c339f774..3a984c7013bb3e55eb7ffbe80797b3f4938f40f2 100644 (file)
@@ -798,7 +798,7 @@ b32 check_struct_literal(AstStructLiteral* sl) {
         if (!types_are_compatible(formal, (*actual)->type)) {
             onyx_report_error(sl->token->pos,
                     "Mismatched types for %d%s member, expected '%s', got '%s'.",
-                    i, bh_num_suffix(i),
+                    i + 1, bh_num_suffix(i + 1),
                     type_get_name(formal),
                     type_get_name((*actual)->type));
             return 1;
index f5286ec6a3007d4e0bcb37b42b6acc0a49ec1aa4..7a691dfaa4ab7c875d042b0891ced6200555f491 100644 (file)
@@ -3007,7 +3007,8 @@ void onyx_wasm_module_compile(OnyxWasmModule* module, ProgramInfo* program) {
 }
 
 void onyx_wasm_module_free(OnyxWasmModule* module) {
-    bh_arena_free(module->extended_instr_data);
+    if (module->extended_instr_data != NULL)
+        bh_arena_free(module->extended_instr_data);
 
     bh_arr_free(module->types);
     bh_arr_free(module->funcs);