authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-23 00:41:11-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-23 00:41:11-04:00
log38568318a087394f02cba21a9617098ccb8b58ee
treef5f6ace3c6f3ad8dc1d26ffa79613fe37dffd908
parent7e303fa28feaa10d7dbf08fdc3e86c47bba882e6
signaturelock-open Commit is signed but in an unrecognized format.

fix some legacy coroutine stuff


5 files changed, 26 insertions(+), 9 deletions(-)

src/ir.cpp+19-2
......@@ -15289,6 +15289,21 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn
1528915289 if (result_loc != nullptr)
1529015290 return result_loc;
1529115291
15292 ZigFn *fn = exec_fn_entry(ira->new_irb.exec);
15293 if (fn != nullptr && fn->type_entry->data.fn.fn_type_id.cc == CallingConventionAsync &&
15294 instruction->result_loc->id == ResultLocIdReturn)
15295 {
15296 result_loc = ir_resolve_result(ira, &instruction->base, no_result_loc(),
15297 implicit_elem_type, nullptr, false, true);
15298 if (result_loc != nullptr &&
15299 (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)))
15300 {
15301 return result_loc;
15302 }
15303 result_loc->value.special = ConstValSpecialRuntime;
15304 return result_loc;
15305 }
15306
1529215307 IrInstruction *result = ir_const(ira, &instruction->base, implicit_elem_type);
1529315308 result->value.special = ConstValSpecialUndef;
1529415309 IrInstruction *ptr = ir_get_ref(ira, &instruction->base, result, false, false);
......@@ -16128,7 +16143,9 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c
1612816143 if (handle_is_ptr(impl_fn_type_id->return_type)) {
1612916144 result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc,
1613016145 impl_fn_type_id->return_type, nullptr, true, true);
16131 if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) {
16146 if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) ||
16147 instr_is_unreachable(result_loc)))
16148 {
1613216149 return result_loc;
1613316150 }
1613416151 } else {
......@@ -16248,7 +16265,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c
1624816265 if (handle_is_ptr(return_type)) {
1624916266 result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc,
1625016267 return_type, nullptr, true, true);
16251 if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) {
16268 if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) {
1625216269 return result_loc;
1625316270 }
1625416271 } else {
std/event/lock.zig+2-2
......@@ -123,8 +123,8 @@ pub const Lock = struct {
123123};
124124
125125test "std.event.Lock" {
126 // https://github.com/ziglang/zig/issues/1908
127 if (builtin.single_threaded) return error.SkipZigTest;
126 // https://github.com/ziglang/zig/issues/2377
127 //if (true) return error.SkipZigTest;
128128
129129 var da = std.heap.DirectAllocator.init();
130130 defer da.deinit();
std/event/net.zig+2-2
......@@ -263,8 +263,8 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !File {
263263}
264264
265265test "listen on a port, send bytes, receive bytes" {
266 // https://github.com/ziglang/zig/issues/1908
267 if (builtin.single_threaded) return error.SkipZigTest;
266 // https://github.com/ziglang/zig/issues/2377
267 if (true) return error.SkipZigTest;
268268
269269 if (builtin.os != builtin.Os.linux) {
270270 // TODO build abstractions for other operating systems
std/event/rwlock.zig+2-2
......@@ -212,8 +212,8 @@ pub const RwLock = struct {
212212};
213213
214214test "std.event.RwLock" {
215 // https://github.com/ziglang/zig/issues/1908
216 if (builtin.single_threaded or builtin.os != builtin.Os.linux) return error.SkipZigTest;
215 // https://github.com/ziglang/zig/issues/2377
216 if (true) return error.SkipZigTest;
217217
218218 var da = std.heap.DirectAllocator.init();
219219 defer da.deinit();
std/std.zig+1-1
......@@ -84,7 +84,7 @@ test "std" {
8484 _ = @import("dwarf.zig");
8585 _ = @import("dynamic_library.zig");
8686 _ = @import("elf.zig");
87 //_ = @import("event.zig");
87 _ = @import("event.zig");
8888 _ = @import("fmt.zig");
8989 _ = @import("fs.zig");
9090 _ = @import("hash.zig");