From 651dc31247c2f637925ed6a6e92c8bc1a19efd5c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 25 Aug 2016 17:25:18 -0700 Subject: implement null as a literal type --- std/debug.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'std/debug.zig') diff --git a/std/debug.zig b/std/debug.zig index 8781c87b25..541c9436a2 100644 --- a/std/debug.zig +++ b/std/debug.zig @@ -40,7 +40,7 @@ pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { %return out_stream.printInt(usize, return_address); %return out_stream.printf(" -> "); - %return out_stream.printInt(u64, debug_info_offset); + %return out_stream.printInt(u64, compile_unit_offset); %return out_stream.printf("\n"); maybe_fp = *(&const ?&const u8)(fp); } @@ -82,7 +82,8 @@ fn findCompileUnitOffset(st: &ElfStackTrace, target_address: usize) -> %u64 { } fn arangesOffset(st: &ElfStackTrace, target_address: usize) -> %?u64 { - const aranges = ?return st.aranges; + // TODO ability to implicitly cast null to %?T + const aranges = st.aranges ?? return (?u64)(null); %return st.elf.seekToSection(aranges); @@ -129,7 +130,8 @@ fn arangesOffset(st: &ElfStackTrace, target_address: usize) -> %?u64 { if (address == 0 && length == 0) break; if (target_address >= address && target_address < address + length) { - return debug_info_offset; + // TODO ability to implicitly cast T to %?T + return (?u64)(debug_info_offset); } } } -- cgit v1.2.3