| author | |
| committer | |
| log | 40ca39d3d5a556e3b5d7298e3a5182f4351bdd17 |
| tree | dd3a782b155b889a915aebd429887f78a699aea5 |
| parent | 3ef6a00bb8854119d39bba521a0256d4884001f5 |
2 files changed, 3 insertions(+), 3 deletions(-)
src/ir.cpp+1-1| ... | @@ -7009,7 +7009,7 @@ static IrInstruction *ir_get_const_ptr(IrAnalyze *ira, IrInstruction *instructio | ... | @@ -7009,7 +7009,7 @@ static IrInstruction *ir_get_const_ptr(IrAnalyze *ira, IrInstruction *instructio |
| 7009 | if (pointee_type->id == TypeTableEntryIdMetaType) { | 7009 | if (pointee_type->id == TypeTableEntryIdMetaType) { |
| 7010 | TypeTableEntry *type_entry = pointee->data.x_type; | 7010 | TypeTableEntry *type_entry = pointee->data.x_type; |
| 7011 | if (type_entry->id == TypeTableEntryIdUnreachable) { | 7011 | if (type_entry->id == TypeTableEntryIdUnreachable) { |
| 7012 | ir_add_error(ira, instruction, buf_sprintf("pointer to unreachable not allowed")); | 7012 | ir_add_error(ira, instruction, buf_sprintf("pointer to noreturn not allowed")); |
| 7013 | return ira->codegen->invalid_instruction; | 7013 | return ira->codegen->invalid_instruction; |
| 7014 | } | 7014 | } |
| 7015 | 7015 |
test/compile_errors.zig+2-2| ... | @@ -372,10 +372,10 @@ pub fn addCases(cases: &tests.CompileErrorContext) void { | ... | @@ -372,10 +372,10 @@ pub fn addCases(cases: &tests.CompileErrorContext) void { |
| 372 | \\export fn entry() void { _ = a(); } | 372 | \\export fn entry() void { _ = a(); } |
| 373 | , ".tmp_source.zig:1:8: error: use of undeclared identifier 'bogus'"); | 373 | , ".tmp_source.zig:1:8: error: use of undeclared identifier 'bogus'"); |
| 374 | 374 | ||
| 375 | cases.add("pointer to unreachable", | 375 | cases.add("pointer to noreturn", |
| 376 | \\fn a() &noreturn {} | 376 | \\fn a() &noreturn {} |
| 377 | \\export fn entry() void { _ = a(); } | 377 | \\export fn entry() void { _ = a(); } |
| 378 | , ".tmp_source.zig:1:9: error: pointer to unreachable not allowed"); | 378 | , ".tmp_source.zig:1:9: error: pointer to noreturn not allowed"); |
| 379 | 379 | ||
| 380 | cases.add("unreachable code", | 380 | cases.add("unreachable code", |
| 381 | \\export fn a() void { | 381 | \\export fn a() void { |