authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-05-13 03:42:20-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-05-15 03:07:51-04:00
log72b4657053f94222c735b7c51c380649ce23c30e
treef240b01ccac04f00addf7eb7746b03e9fc33aa0e
parent904ffb41de9caa3f8f99806518d719beef832b7c

Dwarf: fix overflow write byte_size


2 files changed, 47 insertions(+), 48 deletions(-)

src/link/Dwarf.zig+47-47
...@@ -184,12 +184,14 @@ pub const DeclState = struct {...@@ -184,12 +184,14 @@ pub const DeclState = struct {
184 try dbg_info_buffer.append(@enumToInt(AbbrevKind.pad1));184 try dbg_info_buffer.append(@enumToInt(AbbrevKind.pad1));
185 },185 },
186 .Bool => {186 .Bool => {
187 try dbg_info_buffer.appendSlice(&[_]u8{187 try dbg_info_buffer.ensureUnusedCapacity(12);
188 @enumToInt(AbbrevKind.base_type),188 dbg_info_buffer.appendAssumeCapacity(@enumToInt(AbbrevKind.base_type));
189 DW.ATE.boolean, // DW.AT.encoding , DW.FORM.data1189 // DW.AT.encoding, DW.FORM.data1
190 1, // DW.AT.byte_size, DW.FORM.data1190 dbg_info_buffer.appendAssumeCapacity(DW.ATE.boolean);
191 'b', 'o', 'o', 'l', 0, // DW.AT.name, DW.FORM.string191 // DW.AT.byte_size, DW.FORM.udata
192 });192 try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(target));
193 // DW.AT.name, DW.FORM.string
194 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});
193 },195 },
194 .Int => {196 .Int => {
195 const info = ty.intInfo(target);197 const info = ty.intInfo(target);
...@@ -200,9 +202,9 @@ pub const DeclState = struct {...@@ -200,9 +202,9 @@ pub const DeclState = struct {
200 .signed => DW.ATE.signed,202 .signed => DW.ATE.signed,
201 .unsigned => DW.ATE.unsigned,203 .unsigned => DW.ATE.unsigned,
202 });204 });
203 // DW.AT.byte_size, DW.FORM.data1205 // DW.AT.byte_size, DW.FORM.udata
204 dbg_info_buffer.appendAssumeCapacity(@intCast(u8, ty.abiSize(target)));206 try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(target));
205 // DW.AT.name, DW.FORM.string207 // DW.AT.name, DW.FORM.string
206 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});208 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});
207 },209 },
208 .Optional => {210 .Optional => {
...@@ -211,9 +213,9 @@ pub const DeclState = struct {...@@ -211,9 +213,9 @@ pub const DeclState = struct {
211 dbg_info_buffer.appendAssumeCapacity(@enumToInt(AbbrevKind.base_type));213 dbg_info_buffer.appendAssumeCapacity(@enumToInt(AbbrevKind.base_type));
212 // DW.AT.encoding, DW.FORM.data1214 // DW.AT.encoding, DW.FORM.data1
213 dbg_info_buffer.appendAssumeCapacity(DW.ATE.address);215 dbg_info_buffer.appendAssumeCapacity(DW.ATE.address);
214 // DW.AT.byte_size, DW.FORM.data1216 // DW.AT.byte_size, DW.FORM.udata
215 dbg_info_buffer.appendAssumeCapacity(@intCast(u8, ty.abiSize(target)));217 try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(target));
216 // DW.AT.name, DW.FORM.string218 // DW.AT.name, DW.FORM.string
217 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});219 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});
218 } else {220 } else {
219 // Non-pointer optionals are structs: struct { .maybe = *, .val = * }221 // Non-pointer optionals are structs: struct { .maybe = *, .val = * }
...@@ -221,7 +223,7 @@ pub const DeclState = struct {...@@ -221,7 +223,7 @@ pub const DeclState = struct {
221 const payload_ty = ty.optionalChild(buf);223 const payload_ty = ty.optionalChild(buf);
222 // DW.AT.structure_type224 // DW.AT.structure_type
223 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));225 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));
224 // DW.AT.byte_size, DW.FORM.sdata226 // DW.AT.byte_size, DW.FORM.udata
225 const abi_size = ty.abiSize(target);227 const abi_size = ty.abiSize(target);
226 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);228 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);
227 // DW.AT.name, DW.FORM.string229 // DW.AT.name, DW.FORM.string
...@@ -236,7 +238,7 @@ pub const DeclState = struct {...@@ -236,7 +238,7 @@ pub const DeclState = struct {
236 var index = dbg_info_buffer.items.len;238 var index = dbg_info_buffer.items.len;
237 try dbg_info_buffer.resize(index + 4);239 try dbg_info_buffer.resize(index + 4);
238 try self.addTypeRelocGlobal(atom_index, Type.bool, @intCast(u32, index));240 try self.addTypeRelocGlobal(atom_index, Type.bool, @intCast(u32, index));
239 // DW.AT.data_member_location, DW.FORM.sdata241 // DW.AT.data_member_location, DW.FORM.udata
240 try dbg_info_buffer.ensureUnusedCapacity(6);242 try dbg_info_buffer.ensureUnusedCapacity(6);
241 dbg_info_buffer.appendAssumeCapacity(0);243 dbg_info_buffer.appendAssumeCapacity(0);
242 // DW.AT.member244 // DW.AT.member
...@@ -248,7 +250,7 @@ pub const DeclState = struct {...@@ -248,7 +250,7 @@ pub const DeclState = struct {
248 index = dbg_info_buffer.items.len;250 index = dbg_info_buffer.items.len;
249 try dbg_info_buffer.resize(index + 4);251 try dbg_info_buffer.resize(index + 4);
250 try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(u32, index));252 try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(u32, index));
251 // DW.AT.data_member_location, DW.FORM.sdata253 // DW.AT.data_member_location, DW.FORM.udata
252 const offset = abi_size - payload_ty.abiSize(target);254 const offset = abi_size - payload_ty.abiSize(target);
253 try leb128.writeULEB128(dbg_info_buffer.writer(), offset);255 try leb128.writeULEB128(dbg_info_buffer.writer(), offset);
254 // DW.AT.structure_type delimit children256 // DW.AT.structure_type delimit children
...@@ -263,8 +265,8 @@ pub const DeclState = struct {...@@ -263,8 +265,8 @@ pub const DeclState = struct {
263 // DW.AT.structure_type265 // DW.AT.structure_type
264 try dbg_info_buffer.ensureUnusedCapacity(2);266 try dbg_info_buffer.ensureUnusedCapacity(2);
265 dbg_info_buffer.appendAssumeCapacity(@enumToInt(AbbrevKind.struct_type));267 dbg_info_buffer.appendAssumeCapacity(@enumToInt(AbbrevKind.struct_type));
266 // DW.AT.byte_size, DW.FORM.sdata268 // DW.AT.byte_size, DW.FORM.udata
267 dbg_info_buffer.appendAssumeCapacity(ptr_bytes * 2);269 try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(target));
268 // DW.AT.name, DW.FORM.string270 // DW.AT.name, DW.FORM.string
269 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});271 try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(module)});
270 // DW.AT.member272 // DW.AT.member
...@@ -279,7 +281,7 @@ pub const DeclState = struct {...@@ -279,7 +281,7 @@ pub const DeclState = struct {
279 var buf = try arena.create(Type.SlicePtrFieldTypeBuffer);281 var buf = try arena.create(Type.SlicePtrFieldTypeBuffer);
280 const ptr_ty = ty.slicePtrFieldType(buf);282 const ptr_ty = ty.slicePtrFieldType(buf);
281 try self.addTypeRelocGlobal(atom_index, ptr_ty, @intCast(u32, index));283 try self.addTypeRelocGlobal(atom_index, ptr_ty, @intCast(u32, index));
282 // DW.AT.data_member_location, DW.FORM.sdata284 // DW.AT.data_member_location, DW.FORM.udata
283 try dbg_info_buffer.ensureUnusedCapacity(6);285 try dbg_info_buffer.ensureUnusedCapacity(6);
284 dbg_info_buffer.appendAssumeCapacity(0);286 dbg_info_buffer.appendAssumeCapacity(0);
285 // DW.AT.member287 // DW.AT.member
...@@ -291,7 +293,7 @@ pub const DeclState = struct {...@@ -291,7 +293,7 @@ pub const DeclState = struct {
291 index = dbg_info_buffer.items.len;293 index = dbg_info_buffer.items.len;
292 try dbg_info_buffer.resize(index + 4);294 try dbg_info_buffer.resize(index + 4);
293 try self.addTypeRelocGlobal(atom_index, Type.usize, @intCast(u32, index));295 try self.addTypeRelocGlobal(atom_index, Type.usize, @intCast(u32, index));
294 // DW.AT.data_member_location, DW.FORM.sdata296 // DW.AT.data_member_location, DW.FORM.udata
295 try dbg_info_buffer.ensureUnusedCapacity(2);297 try dbg_info_buffer.ensureUnusedCapacity(2);
296 dbg_info_buffer.appendAssumeCapacity(ptr_bytes);298 dbg_info_buffer.appendAssumeCapacity(ptr_bytes);
297 // DW.AT.structure_type delimit children299 // DW.AT.structure_type delimit children
...@@ -329,9 +331,8 @@ pub const DeclState = struct {...@@ -329,9 +331,8 @@ pub const DeclState = struct {
329 .Struct => blk: {331 .Struct => blk: {
330 // DW.AT.structure_type332 // DW.AT.structure_type
331 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));333 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));
332 // DW.AT.byte_size, DW.FORM.sdata334 // DW.AT.byte_size, DW.FORM.udata
333 const abi_size = ty.abiSize(target);335 try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(target));
334 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);
335336
336 switch (ty.tag()) {337 switch (ty.tag()) {
337 .tuple, .anon_struct => {338 .tuple, .anon_struct => {
...@@ -348,7 +349,7 @@ pub const DeclState = struct {...@@ -348,7 +349,7 @@ pub const DeclState = struct {
348 var index = dbg_info_buffer.items.len;349 var index = dbg_info_buffer.items.len;
349 try dbg_info_buffer.resize(index + 4);350 try dbg_info_buffer.resize(index + 4);
350 try self.addTypeRelocGlobal(atom_index, field, @intCast(u32, index));351 try self.addTypeRelocGlobal(atom_index, field, @intCast(u32, index));
351 // DW.AT.data_member_location, DW.FORM.sdata352 // DW.AT.data_member_location, DW.FORM.udata
352 const field_off = ty.structFieldOffset(field_index, target);353 const field_off = ty.structFieldOffset(field_index, target);
353 try leb128.writeULEB128(dbg_info_buffer.writer(), field_off);354 try leb128.writeULEB128(dbg_info_buffer.writer(), field_off);
354 }355 }
...@@ -380,7 +381,7 @@ pub const DeclState = struct {...@@ -380,7 +381,7 @@ pub const DeclState = struct {
380 var index = dbg_info_buffer.items.len;381 var index = dbg_info_buffer.items.len;
381 try dbg_info_buffer.resize(index + 4);382 try dbg_info_buffer.resize(index + 4);
382 try self.addTypeRelocGlobal(atom_index, field.ty, @intCast(u32, index));383 try self.addTypeRelocGlobal(atom_index, field.ty, @intCast(u32, index));
383 // DW.AT.data_member_location, DW.FORM.sdata384 // DW.AT.data_member_location, DW.FORM.udata
384 const field_off = ty.structFieldOffset(field_index, target);385 const field_off = ty.structFieldOffset(field_index, target);
385 try leb128.writeULEB128(dbg_info_buffer.writer(), field_off);386 try leb128.writeULEB128(dbg_info_buffer.writer(), field_off);
386 }387 }
...@@ -393,9 +394,8 @@ pub const DeclState = struct {...@@ -393,9 +394,8 @@ pub const DeclState = struct {
393 .Enum => {394 .Enum => {
394 // DW.AT.enumeration_type395 // DW.AT.enumeration_type
395 try dbg_info_buffer.append(@enumToInt(AbbrevKind.enum_type));396 try dbg_info_buffer.append(@enumToInt(AbbrevKind.enum_type));
396 // DW.AT.byte_size, DW.FORM.sdata397 // DW.AT.byte_size, DW.FORM.udata
397 const abi_size = ty.abiSize(target);398 try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(target));
398 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);
399 // DW.AT.name, DW.FORM.string399 // DW.AT.name, DW.FORM.string
400 const enum_name = try ty.nameAllocArena(arena, module);400 const enum_name = try ty.nameAllocArena(arena, module);
401 try dbg_info_buffer.ensureUnusedCapacity(enum_name.len + 1);401 try dbg_info_buffer.ensureUnusedCapacity(enum_name.len + 1);
...@@ -446,7 +446,7 @@ pub const DeclState = struct {...@@ -446,7 +446,7 @@ pub const DeclState = struct {
446 if (is_tagged) {446 if (is_tagged) {
447 // DW.AT.structure_type447 // DW.AT.structure_type
448 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));448 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));
449 // DW.AT.byte_size, DW.FORM.sdata449 // DW.AT.byte_size, DW.FORM.udata
450 try leb128.writeULEB128(dbg_info_buffer.writer(), layout.abi_size);450 try leb128.writeULEB128(dbg_info_buffer.writer(), layout.abi_size);
451 // DW.AT.name, DW.FORM.string451 // DW.AT.name, DW.FORM.string
452 try dbg_info_buffer.ensureUnusedCapacity(union_name.len + 1);452 try dbg_info_buffer.ensureUnusedCapacity(union_name.len + 1);
...@@ -463,13 +463,13 @@ pub const DeclState = struct {...@@ -463,13 +463,13 @@ pub const DeclState = struct {
463 const inner_union_index = dbg_info_buffer.items.len;463 const inner_union_index = dbg_info_buffer.items.len;
464 try dbg_info_buffer.resize(inner_union_index + 4);464 try dbg_info_buffer.resize(inner_union_index + 4);
465 try self.addTypeRelocLocal(atom_index, @intCast(u32, inner_union_index), 5);465 try self.addTypeRelocLocal(atom_index, @intCast(u32, inner_union_index), 5);
466 // DW.AT.data_member_location, DW.FORM.sdata466 // DW.AT.data_member_location, DW.FORM.udata
467 try leb128.writeULEB128(dbg_info_buffer.writer(), payload_offset);467 try leb128.writeULEB128(dbg_info_buffer.writer(), payload_offset);
468 }468 }
469469
470 // DW.AT.union_type470 // DW.AT.union_type
471 try dbg_info_buffer.append(@enumToInt(AbbrevKind.union_type));471 try dbg_info_buffer.append(@enumToInt(AbbrevKind.union_type));
472 // DW.AT.byte_size, DW.FORM.sdata,472 // DW.AT.byte_size, DW.FORM.udata,
473 try leb128.writeULEB128(dbg_info_buffer.writer(), layout.payload_size);473 try leb128.writeULEB128(dbg_info_buffer.writer(), layout.payload_size);
474 // DW.AT.name, DW.FORM.string474 // DW.AT.name, DW.FORM.string
475 if (is_tagged) {475 if (is_tagged) {
...@@ -490,7 +490,7 @@ pub const DeclState = struct {...@@ -490,7 +490,7 @@ pub const DeclState = struct {
490 const index = dbg_info_buffer.items.len;490 const index = dbg_info_buffer.items.len;
491 try dbg_info_buffer.resize(index + 4);491 try dbg_info_buffer.resize(index + 4);
492 try self.addTypeRelocGlobal(atom_index, field.ty, @intCast(u32, index));492 try self.addTypeRelocGlobal(atom_index, field.ty, @intCast(u32, index));
493 // DW.AT.data_member_location, DW.FORM.sdata493 // DW.AT.data_member_location, DW.FORM.udata
494 try dbg_info_buffer.append(0);494 try dbg_info_buffer.append(0);
495 }495 }
496 // DW.AT.union_type delimit children496 // DW.AT.union_type delimit children
...@@ -507,7 +507,7 @@ pub const DeclState = struct {...@@ -507,7 +507,7 @@ pub const DeclState = struct {
507 const index = dbg_info_buffer.items.len;507 const index = dbg_info_buffer.items.len;
508 try dbg_info_buffer.resize(index + 4);508 try dbg_info_buffer.resize(index + 4);
509 try self.addTypeRelocGlobal(atom_index, union_obj.tag_ty, @intCast(u32, index));509 try self.addTypeRelocGlobal(atom_index, union_obj.tag_ty, @intCast(u32, index));
510 // DW.AT.data_member_location, DW.FORM.sdata510 // DW.AT.data_member_location, DW.FORM.udata
511 try leb128.writeULEB128(dbg_info_buffer.writer(), tag_offset);511 try leb128.writeULEB128(dbg_info_buffer.writer(), tag_offset);
512512
513 // DW.AT.structure_type delimit children513 // DW.AT.structure_type delimit children
...@@ -534,7 +534,7 @@ pub const DeclState = struct {...@@ -534,7 +534,7 @@ pub const DeclState = struct {
534534
535 // DW.AT.structure_type535 // DW.AT.structure_type
536 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));536 try dbg_info_buffer.append(@enumToInt(AbbrevKind.struct_type));
537 // DW.AT.byte_size, DW.FORM.sdata537 // DW.AT.byte_size, DW.FORM.udata
538 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);538 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);
539 // DW.AT.name, DW.FORM.string539 // DW.AT.name, DW.FORM.string
540 const name = try ty.nameAllocArena(arena, module);540 const name = try ty.nameAllocArena(arena, module);
...@@ -551,7 +551,7 @@ pub const DeclState = struct {...@@ -551,7 +551,7 @@ pub const DeclState = struct {
551 const index = dbg_info_buffer.items.len;551 const index = dbg_info_buffer.items.len;
552 try dbg_info_buffer.resize(index + 4);552 try dbg_info_buffer.resize(index + 4);
553 try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(u32, index));553 try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(u32, index));
554 // DW.AT.data_member_location, DW.FORM.sdata554 // DW.AT.data_member_location, DW.FORM.udata
555 try leb128.writeULEB128(dbg_info_buffer.writer(), payload_off);555 try leb128.writeULEB128(dbg_info_buffer.writer(), payload_off);
556 }556 }
557557
...@@ -566,7 +566,7 @@ pub const DeclState = struct {...@@ -566,7 +566,7 @@ pub const DeclState = struct {
566 const index = dbg_info_buffer.items.len;566 const index = dbg_info_buffer.items.len;
567 try dbg_info_buffer.resize(index + 4);567 try dbg_info_buffer.resize(index + 4);
568 try self.addTypeRelocGlobal(atom_index, error_ty, @intCast(u32, index));568 try self.addTypeRelocGlobal(atom_index, error_ty, @intCast(u32, index));
569 // DW.AT.data_member_location, DW.FORM.sdata569 // DW.AT.data_member_location, DW.FORM.udata
570 try leb128.writeULEB128(dbg_info_buffer.writer(), error_off);570 try leb128.writeULEB128(dbg_info_buffer.writer(), error_off);
571 }571 }
572572
...@@ -647,8 +647,8 @@ pub const DeclState = struct {...@@ -647,8 +647,8 @@ pub const DeclState = struct {
647647
648 try dbg_info.ensureUnusedCapacity(5 + name_with_null.len);648 try dbg_info.ensureUnusedCapacity(5 + name_with_null.len);
649 const index = dbg_info.items.len;649 const index = dbg_info.items.len;
650 try dbg_info.resize(index + 4); // dw.at.type, dw.form.ref4650 try dbg_info.resize(index + 4); // dw.at.type, dw.form.ref4
651 try self.addTypeRelocGlobal(atom_index, ty, @intCast(u32, index)); // DW.AT.type, DW.FORM.ref4651 try self.addTypeRelocGlobal(atom_index, ty, @intCast(u32, index)); // DW.AT.type, DW.FORM.ref4
652 dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string652 dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string
653 }653 }
654654
...@@ -790,7 +790,7 @@ pub const DeclState = struct {...@@ -790,7 +790,7 @@ pub const DeclState = struct {
790790
791 try dbg_info.ensureUnusedCapacity(5 + name_with_null.len);791 try dbg_info.ensureUnusedCapacity(5 + name_with_null.len);
792 const index = dbg_info.items.len;792 const index = dbg_info.items.len;
793 try dbg_info.resize(index + 4); // dw.at.type, dw.form.ref4793 try dbg_info.resize(index + 4); // dw.at.type, dw.form.ref4
794 try self.addTypeRelocGlobal(atom_index, child_ty, @intCast(u32, index));794 try self.addTypeRelocGlobal(atom_index, child_ty, @intCast(u32, index));
795 dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string795 dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string
796 }796 }
...@@ -993,13 +993,13 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: Module.Decl.Index)...@@ -993,13 +993,13 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: Module.Decl.Index)
993 // "relocations" and have to be in this fixed place so that functions can be993 // "relocations" and have to be in this fixed place so that functions can be
994 // moved in virtual address space.994 // moved in virtual address space.
995 assert(dbg_info_low_pc_reloc_index == dbg_info_buffer.items.len);995 assert(dbg_info_low_pc_reloc_index == dbg_info_buffer.items.len);
996 dbg_info_buffer.items.len += ptr_width_bytes; // DW.AT.low_pc, DW.FORM.addr996 dbg_info_buffer.items.len += ptr_width_bytes; // DW.AT.low_pc, DW.FORM.addr
997 assert(self.getRelocDbgInfoSubprogramHighPC() == dbg_info_buffer.items.len);997 assert(self.getRelocDbgInfoSubprogramHighPC() == dbg_info_buffer.items.len);
998 dbg_info_buffer.items.len += 4; // DW.AT.high_pc, DW.FORM.data4998 dbg_info_buffer.items.len += 4; // DW.AT.high_pc, DW.FORM.data4
999 //999 //
1000 if (fn_ret_has_bits) {1000 if (fn_ret_has_bits) {
1001 try decl_state.addTypeRelocGlobal(di_atom_index, fn_ret_type, @intCast(u32, dbg_info_buffer.items.len));1001 try decl_state.addTypeRelocGlobal(di_atom_index, fn_ret_type, @intCast(u32, dbg_info_buffer.items.len));
1002 dbg_info_buffer.items.len += 4; // DW.AT.type, DW.FORM.ref41002 dbg_info_buffer.items.len += 4; // DW.AT.type, DW.FORM.ref4
1003 }1003 }
10041004
1005 dbg_info_buffer.appendSliceAssumeCapacity(decl_name_with_null); // DW.AT.name, DW.FORM.string1005 dbg_info_buffer.appendSliceAssumeCapacity(decl_name_with_null); // DW.AT.name, DW.FORM.string
...@@ -1619,7 +1619,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {...@@ -1619,7 +1619,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {
1619 DW.AT.encoding,1619 DW.AT.encoding,
1620 DW.FORM.data1,1620 DW.FORM.data1,
1621 DW.AT.byte_size,1621 DW.AT.byte_size,
1622 DW.FORM.data1,1622 DW.FORM.udata,
1623 DW.AT.name,1623 DW.AT.name,
1624 DW.FORM.string,1624 DW.FORM.string,
1625 0,1625 0,
...@@ -1635,7 +1635,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {...@@ -1635,7 +1635,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {
1635 DW.TAG.structure_type,1635 DW.TAG.structure_type,
1636 DW.CHILDREN.yes, // header1636 DW.CHILDREN.yes, // header
1637 DW.AT.byte_size,1637 DW.AT.byte_size,
1638 DW.FORM.sdata,1638 DW.FORM.udata,
1639 DW.AT.name,1639 DW.AT.name,
1640 DW.FORM.string,1640 DW.FORM.string,
1641 0,1641 0,
...@@ -1648,14 +1648,14 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {...@@ -1648,14 +1648,14 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {
1648 DW.AT.type,1648 DW.AT.type,
1649 DW.FORM.ref4,1649 DW.FORM.ref4,
1650 DW.AT.data_member_location,1650 DW.AT.data_member_location,
1651 DW.FORM.sdata,1651 DW.FORM.udata,
1652 0,1652 0,
1653 0, // table sentinel1653 0, // table sentinel
1654 @enumToInt(AbbrevKind.enum_type),1654 @enumToInt(AbbrevKind.enum_type),
1655 DW.TAG.enumeration_type,1655 DW.TAG.enumeration_type,
1656 DW.CHILDREN.yes, // header1656 DW.CHILDREN.yes, // header
1657 DW.AT.byte_size,1657 DW.AT.byte_size,
1658 DW.FORM.sdata,1658 DW.FORM.udata,
1659 DW.AT.name,1659 DW.AT.name,
1660 DW.FORM.string,1660 DW.FORM.string,
1661 0,1661 0,
...@@ -1673,7 +1673,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {...@@ -1673,7 +1673,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void {
1673 DW.TAG.union_type,1673 DW.TAG.union_type,
1674 DW.CHILDREN.yes, // header1674 DW.CHILDREN.yes, // header
1675 DW.AT.byte_size,1675 DW.AT.byte_size,
1676 DW.FORM.sdata,1676 DW.FORM.udata,
1677 DW.AT.name,1677 DW.AT.name,
1678 DW.FORM.string,1678 DW.FORM.string,
1679 0,1679 0,
...@@ -2628,7 +2628,7 @@ fn addDbgInfoErrorSet(...@@ -2628,7 +2628,7 @@ fn addDbgInfoErrorSet(
26282628
2629 // DW.AT.enumeration_type2629 // DW.AT.enumeration_type
2630 try dbg_info_buffer.append(@enumToInt(AbbrevKind.enum_type));2630 try dbg_info_buffer.append(@enumToInt(AbbrevKind.enum_type));
2631 // DW.AT.byte_size, DW.FORM.sdata2631 // DW.AT.byte_size, DW.FORM.udata
2632 const abi_size = Type.anyerror.abiSize(target);2632 const abi_size = Type.anyerror.abiSize(target);
2633 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);2633 try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size);
2634 // DW.AT.name, DW.FORM.string2634 // DW.AT.name, DW.FORM.string
test/behavior/int_comparison_elision.zig-1
...@@ -15,7 +15,6 @@ test "int comparison elision" {...@@ -15,7 +15,6 @@ test "int comparison elision" {
1515
16 // TODO: support int types > 128 bits wide in other backends16 // TODO: support int types > 128 bits wide in other backends
17 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO17 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
18 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
19 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO18 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
20 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO19 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2120