Ver Fonte

Fix `os.stat` code; make `fmt.panicf` diverging

gingerBill há 5 anos atrás
pai
commit
9513cf1ac6
2 ficheiros alterados com 1 adições e 2 exclusões
  1. 1 1
      core/fmt/fmt.odin
  2. 0 1
      core/os/stat_windows.odin

+ 1 - 1
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;

+ 0 - 1
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);