aboutsummaryrefslogtreecommitdiff
path: root/std/debug.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-08-25 17:25:18 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-08-29 22:14:09 -0700
commit651dc31247c2f637925ed6a6e92c8bc1a19efd5c (patch)
tree7e75713d6c4c9b5dfc8783759b5ed60b5e9e71bf /std/debug.zig
parent1f7ec741fa5b1d9ba3826e06a8a8a0feec58876f (diff)
downloadzig-651dc31247c2f637925ed6a6e92c8bc1a19efd5c.tar.gz
zig-651dc31247c2f637925ed6a6e92c8bc1a19efd5c.zip
implement null as a literal type
Diffstat (limited to 'std/debug.zig')
-rw-r--r--std/debug.zig8
1 files changed, 5 insertions, 3 deletions
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);
}
}
}