From 9513cf1ac6c6c3d752ca6d56969a593a6832dd90 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 30 Sep 2020 22:04:39 +0100 Subject: [PATCH] Fix `os.stat` code; make `fmt.panicf` diverging --- core/fmt/fmt.odin | 2 +- core/os/stat_windows.odin | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index d82963fee..8117caa22 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -165,7 +165,7 @@ assertf :: proc(condition: bool, fmt: string, args: ..any, loc := #caller_locati return condition; } -panicf :: proc(fmt: string, args: ..any, loc := #caller_location) { +panicf :: proc(fmt: string, args: ..any, loc := #caller_location) -> ! { p := context.assertion_failure_proc; if p == nil { p = runtime.default_assertion_failure_proc; diff --git a/core/os/stat_windows.odin b/core/os/stat_windows.odin index 6bd758336..53f41cd1b 100644 --- a/core/os/stat_windows.odin +++ b/core/os/stat_windows.odin @@ -10,7 +10,6 @@ full_path_from_name :: proc(name: string, allocator := context.allocator) -> (pa name = "."; } p := win32.utf8_to_utf16(name, context.temp_allocator); - defer delete(p); buf := make([dynamic]u16, 100, allocator); for { n := win32.GetFullPathNameW(raw_data(p), u32(len(buf)), raw_data(buf), nil);