| ... | ... | @@ -3992,9 +3992,10 @@ uint32_t get_ptr_align(CodeGen *g, ZigType *type) { |
| 3992 | 3992 | return (ptr_type->data.pointer.explicit_alignment == 0) ? |
| 3993 | 3993 | get_abi_alignment(g, ptr_type->data.pointer.child_type) : ptr_type->data.pointer.explicit_alignment; |
| 3994 | 3994 | } else if (ptr_type->id == ZigTypeIdFn) { |
| 3995 | | return (ptr_type->data.fn.fn_type_id.alignment == 0) ? |
| 3996 | | LLVMABIAlignmentOfType(g->target_data_ref, ptr_type->data.fn.raw_type_ref) : |
| 3997 | | ptr_type->data.fn.fn_type_id.alignment; |
| 3995 | // I tried making this use LLVMABIAlignmentOfType but it trips this assertion in LLVM: |
| 3996 | // "Cannot getTypeInfo() on a type that is unsized!" |
| 3997 | // when getting the alignment of `?extern fn() void`. |
| 3998 | return (ptr_type->data.fn.fn_type_id.alignment == 0) ? 1 : ptr_type->data.fn.fn_type_id.alignment; |
| 3998 | 3999 | } else if (ptr_type->id == ZigTypeIdPromise) { |
| 3999 | 4000 | return get_coro_frame_align_bytes(g); |
| 4000 | 4001 | } else { |