From f7e9d7aa5d115a6a8158625cd1aceb7e8dafe880 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 7 Apr 2017 15:34:13 -0400 Subject: ability to implicitly cast integer literal to &const Int where Int is an integer type also introduce `@intToPtr` builtin for converting a usize to a pointer. users now have to use this instead of `(&T)(int)`. closes #311 --- std/debug.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'std/debug.zig') diff --git a/std/debug.zig b/std/debug.zig index 40775eba8d..529c459992 100644 --- a/std/debug.zig +++ b/std/debug.zig @@ -68,7 +68,7 @@ pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { var maybe_fp: ?&const u8 = @frameAddress(); while (true) { const fp = maybe_fp ?? break; - const return_address = *(&const usize)(usize(fp) + @sizeOf(usize)); + const return_address = *@intToPtr(&const usize, usize(fp) + @sizeOf(usize)); const compile_unit = findCompileUnit(st, return_address) ?? return error.MissingDebugInfo; const name = %return compile_unit.die.getAttrString(st, DW.AT_name); -- cgit v1.2.3