break;
}
- case Ast_Kind_Pointer_Type: CHECK(type, &((AstPointerType *) type)->elem); break;
- case Ast_Kind_Slice_Type: CHECK(type, &((AstSliceType *) type)->elem); break;
- case Ast_Kind_DynArr_Type: CHECK(type, &((AstDynArrType *) type)->elem); break;
- case Ast_Kind_VarArg_Type: CHECK(type, &((AstVarArgType *) type)->elem); break;
+ case Ast_Kind_Pointer_Type: ((AstPointerType *) type)->elem->flags |= type->flags & Ast_Flag_Header_Check_No_Error; CHECK(type, &((AstPointerType *) type)->elem); break;
+ case Ast_Kind_Slice_Type: ((AstSliceType *) type)->elem->flags |= type->flags & Ast_Flag_Header_Check_No_Error; CHECK(type, &((AstSliceType *) type)->elem); break;
+ case Ast_Kind_DynArr_Type: ((AstDynArrType *) type)->elem->flags |= type->flags & Ast_Flag_Header_Check_No_Error; CHECK(type, &((AstDynArrType *) type)->elem); break;
+ case Ast_Kind_VarArg_Type: ((AstVarArgType *) type)->elem->flags |= type->flags & Ast_Flag_Header_Check_No_Error; CHECK(type, &((AstVarArgType *) type)->elem); break;
case Ast_Kind_Function_Type: {
AstFunctionType* ftype = (AstFunctionType *) type;
switch (type_node->kind) {
case Ast_Kind_Pointer_Type: {
+ // ((AstPointerType *) type_node)->elem->flags |= type_node->flags & Ast_Flag_Header_Check_No_Error;
Type* ptr_type = type_make_pointer(alloc, type_build_from_ast(alloc, ((AstPointerType *) type_node)->elem));
if (ptr_type) ptr_type->ast_type = type_node;
return ptr_type;
Type* type_make_pointer(bh_allocator alloc, Type* to) {
if (to == NULL) return NULL;
+ if (to == (Type *) &node_that_signals_failure) return to;
assert(to->id > 0);
u64 ptr_id = bh_imap_get(&type_pointer_map, to->id);
Type* type_make_array(bh_allocator alloc, Type* to, u32 count) {
if (to == NULL) return NULL;
+ if (to == (Type *) &node_that_signals_failure) return to;
assert(to->id > 0);
u64 key = ((((u64) to->id) << 32) | (u64) count);
Type* type_make_slice(bh_allocator alloc, Type* of) {
if (of == NULL) return NULL;
+ if (of == (Type *) &node_that_signals_failure) return of;
assert(of->id > 0);
u64 slice_id = bh_imap_get(&type_slice_map, of->id);
Type* type_make_dynarray(bh_allocator alloc, Type* of) {
if (of == NULL) return NULL;
+ if (of == (Type *) &node_that_signals_failure) return of;
assert(of->id > 0);
u64 dynarr_id = bh_imap_get(&type_dynarr_map, of->id);
Type* type_make_varargs(bh_allocator alloc, Type* of) {
if (of == NULL) return NULL;
+ if (of == (Type *) &node_that_signals_failure) return of;
assert(of->id > 0);
u64 vararg_id = bh_imap_get(&type_vararg_map, of->id);