mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 13:00:28 +00:00
Fix fmt.println a rawptr causes access violation #356
This commit is contained in:
@@ -1040,8 +1040,8 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
|
||||
if v.id == typeid_of(^runtime.Type_Info) {
|
||||
write_type(fi.buf, (^^runtime.Type_Info)(v.data)^);
|
||||
} else {
|
||||
if verb != 'p' {
|
||||
ptr := (^rawptr)(v.data)^;
|
||||
ptr := (^rawptr)(v.data)^;
|
||||
if verb != 'p' && info.elem != nil {
|
||||
a := any{ptr, info.elem.id};
|
||||
|
||||
elem := runtime.type_info_base(info.elem);
|
||||
@@ -1077,7 +1077,7 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt_pointer(fi, (^rawptr)(v.data)^, verb);
|
||||
fmt_pointer(fi, ptr, verb);
|
||||
}
|
||||
|
||||
case runtime.Type_Info_Array:
|
||||
|
||||
Reference in New Issue
Block a user