mirror of
https://github.com/ziglang/zig.git
synced 2024-11-17 01:23:54 +00:00
Sema: fix memory leak in zirTypeInfo
This commit is contained in:
parent
dc63426b1e
commit
33644546a0
@ -17627,7 +17627,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
|
|||||||
const name = if (struct_type.fieldName(ip, i).unwrap()) |name_nts|
|
const name = if (struct_type.fieldName(ip, i).unwrap()) |name_nts|
|
||||||
try sema.arena.dupe(u8, ip.stringToSlice(name_nts))
|
try sema.arena.dupe(u8, ip.stringToSlice(name_nts))
|
||||||
else
|
else
|
||||||
try std.fmt.allocPrintZ(gpa, "{d}", .{i});
|
try std.fmt.allocPrintZ(sema.arena, "{d}", .{i});
|
||||||
const field_ty = struct_type.field_types.get(ip)[i].toType();
|
const field_ty = struct_type.field_types.get(ip)[i].toType();
|
||||||
const field_init = struct_type.fieldInit(ip, i);
|
const field_init = struct_type.fieldInit(ip, i);
|
||||||
const field_is_comptime = struct_type.fieldIsComptime(ip, i);
|
const field_is_comptime = struct_type.fieldIsComptime(ip, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user