| ... | @@ -1988,7 +1988,7 @@ static ZigType *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *child_sc | ... | @@ -1988,7 +1988,7 @@ static ZigType *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *child_sc |
| 1988 | // behaviour when checking expected alignment with `@ptrToInt(fn_ptr)` | 1988 | // behaviour when checking expected alignment with `@ptrToInt(fn_ptr)` |
| 1989 | // or similar. This commit proposes to make `align` expressions a | 1989 | // or similar. This commit proposes to make `align` expressions a |
| 1990 | // compile error when compiled to Wasm architecture. | 1990 | // compile error when compiled to Wasm architecture. |
| 1991 | // | 1991 | // |
| 1992 | // Some references: | 1992 | // Some references: |
| 1993 | // [1] [Mozilla: WebAssembly Tables](https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format#WebAssembly_tables) | 1993 | // [1] [Mozilla: WebAssembly Tables](https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format#WebAssembly_tables) |
| 1994 | // [2] [Sunfishcode's Wasm Ref Manual](https://github.com/sunfishcode/wasm-reference-manual/blob/master/WebAssembly.md#indirect-call) | 1994 | // [2] [Sunfishcode's Wasm Ref Manual](https://github.com/sunfishcode/wasm-reference-manual/blob/master/WebAssembly.md#indirect-call) |
| ... | @@ -8052,10 +8052,13 @@ not_integer: | ... | @@ -8052,10 +8052,13 @@ not_integer: |
| 8052 | } | 8052 | } |
| 8053 | | 8053 | |
| 8054 | Error file_fetch(CodeGen *g, Buf *resolved_path, Buf *contents_buf) { | 8054 | Error file_fetch(CodeGen *g, Buf *resolved_path, Buf *contents_buf) { |
| 8055 | size_t len; | 8055 | size_t len = 0xAA; |
| 8056 | const char *contents = stage2_fetch_file(&g->stage1, buf_ptr(resolved_path), buf_len(resolved_path), &len); | 8056 | const char *contents = stage2_fetch_file(&g->stage1, buf_ptr(resolved_path), buf_len(resolved_path), &len); |
| 8057 | if (contents == nullptr) | 8057 | if (len == 0) { |
| | 8058 | // File exists but is empty (otherwise it would be 0xAA) |
| | 8059 | } else if (contents == nullptr) { |
| 8058 | return ErrorFileNotFound; | 8060 | return ErrorFileNotFound; |
| | 8061 | } |
| 8059 | buf_init_from_mem(contents_buf, contents, len); | 8062 | buf_init_from_mem(contents_buf, contents, len); |
| 8060 | return ErrorNone; | 8063 | return ErrorNone; |
| 8061 | } | 8064 | } |
| ... | @@ -9044,7 +9047,7 @@ static void resolve_llvm_types_optional(CodeGen *g, ZigType *type, ResolveStatus | ... | @@ -9044,7 +9047,7 @@ static void resolve_llvm_types_optional(CodeGen *g, ZigType *type, ResolveStatus |
| 9044 | 8 * child_type->abi_align, | 9047 | 8 * child_type->abi_align, |
| 9045 | val_offset_in_bits, | 9048 | val_offset_in_bits, |
| 9046 | ZigLLVM_DIFlags_Zero, child_llvm_di_type); | 9049 | ZigLLVM_DIFlags_Zero, child_llvm_di_type); |
| 9047 | di_element_types[maybe_null_index] = | 9050 | di_element_types[maybe_null_index] = |
| 9048 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(type->llvm_di_type), | 9051 | ZigLLVMCreateDebugMemberType(g->dbuilder, ZigLLVMTypeToScope(type->llvm_di_type), |
| 9049 | "maybe", di_file, line, | 9052 | "maybe", di_file, line, |
| 9050 | 8*g->builtin_types.entry_bool->abi_size, | 9053 | 8*g->builtin_types.entry_bool->abi_size, |