From 60b1cf2a8300591b9b17cc5644bebd358860e7a6 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Wed, 19 Jun 2019 17:11:36 -0400 Subject: [PATCH 1/3] fix macOS stack trace regression f8f054b354088eb9e76d9207972022bc1d3dfc28 exposes the issue where macho symbol `__mh_execute_header` is weak exported with an extra underscore and stack traces fail due to invalid header magic. related #2700 --- std/c/darwin.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/c/darwin.zig b/std/c/darwin.zig index 14a5baff5c..f2e8120a0e 100644 --- a/std/c/darwin.zig +++ b/std/c/darwin.zig @@ -37,7 +37,7 @@ const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header; pub extern "c" var _mh_execute_header: mach_hdr = undefined; comptime { if (std.os.darwin.is_the_target) { - @export("__mh_execute_header", _mh_execute_header, .Weak); + @export("_mh_execute_header", _mh_execute_header, .Weak); } } From 2cbcf3f38bb32752b449ce72a8d8f978e65008f8 Mon Sep 17 00:00:00 2001 From: Matthew Murray Date: Thu, 20 Jun 2019 14:36:34 +0100 Subject: [PATCH 2/3] Fix absFloat --- std/math.zig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/std/math.zig b/std/math.zig index 96f38aca9f..ac06a07953 100644 --- a/std/math.zig +++ b/std/math.zig @@ -482,7 +482,16 @@ fn testAbsInt() void { testing.expect((absInt(i32(10)) catch unreachable) == 10); } -pub const absFloat = @import("fabs.zig").fabs; +pub const absFloat = fabs; + +test "math.absFloat" { + testAbsFloat(); + comptime testAbsFloat(); +} +fn testAbsFloat() void { + testing.expect(absFloat(f32(-10.05)) == 10.05); + testing.expect(absFloat(f32(10.05)) == 10.05); +} pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T { @setRuntimeSafety(false); From be51511d295269851ea4128f0fd3db49fe96a661 Mon Sep 17 00:00:00 2001 From: Gray Olson Date: Fri, 21 Jun 2019 20:54:00 -0700 Subject: [PATCH 3/3] Update langref.html.in --- doc/langref.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 5ddd572e51..54223a9ce3 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -3787,7 +3787,7 @@ test "fn reflection" { However right now it is hard coded to be a {#syntax#}u16{#endsyntax#}. See #768.

- You can {#link|implicitly cast|Implicit Casts#} an error from a subset to its superset: + You can {#link|implicitly cast|Implicit Casts#} an error from a subset to a superset:

{#code_begin|test#} const std = @import("std");