bug fix that crashed RemedyDB when debugging
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 25 Jan 2021 14:39:12 +0000 (08:39 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 25 Jan 2021 14:39:12 +0000 (08:39 -0600)
probably due to stack overload and corrupting the stack frames.

bin/onyx
onyx.exe
src/onyxutils.c

index ef1151957c7b99ebc508a56e6bd47525e70bcaa2..02dedce095a61faef823275f3b88c3f3030dc0ae 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index 225bf424b90f3dae6ca7548de94985529ef4b974..3b67597bcce4e7674034494d2039ebdb6a71ded7 100644 (file)
Binary files a/onyx.exe and b/onyx.exe differ
index c8e7630836e755ab0caef15aba7b82613159940a..09a97de69e5519e9ffb1de4103d2da5b8e5d525a 100644 (file)
@@ -955,6 +955,7 @@ AstStructType* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstP
     insert_poly_slns_into_scope(ps_type->scope, slns);
 
     AstStructType* concrete_struct = (AstStructType *) ast_clone(context.ast_alloc, ps_type->base_struct);
+    bh_table_put(AstStructType *, ps_type->concrete_structs, unique_key, concrete_struct);
 
     Entity struct_entity = {
         .state = Entity_State_Resolve_Symbols,
@@ -982,8 +983,6 @@ AstStructType* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstP
         return NULL;
     }
 
-    bh_table_put(AstStructType *, ps_type->concrete_structs, unique_key, concrete_struct);
-
     Type* cs_type = type_build_from_ast(context.ast_alloc, (AstType *) concrete_struct);
 
     // CLEANUP: This should not be necessary since the only place this function can be