From eb83111f0258ee41af021091bb78b3b5e5f6f3d3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 7 May 2016 19:58:02 -0700 Subject: add debug safety for division See #149 --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 564cad1758..798ef5af52 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -395,13 +395,13 @@ int main(int argc, char **argv) { codegen_add_root_code(g, &root_source_dir, &root_source_name, &root_source_code); codegen_link(g, "./test"); ZigList args = {0}; - int return_code; - os_spawn_process("./test", args, &return_code); - if (return_code != 0) { + Termination term; + os_spawn_process("./test", args, &term); + if (term.how != TerminationIdClean || term.code != 0) { fprintf(stderr, "\nTests failed. Use the following command to reproduce the failure:\n"); fprintf(stderr, "./test\n"); } - return return_code; + return (term.how == TerminationIdClean) ? term.code : -1; } else { zig_unreachable(); } -- cgit v1.2.3