mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
Zir: add missing extra index for linksection_or_addspace
Closes #18052 Closes #18104 Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
parent
648f592db1
commit
2fefc0b5c7
@ -3416,8 +3416,9 @@ pub const DeclIterator = struct {
|
||||
it.extra_index += 5; // src_hash(4) + line(1)
|
||||
const name = it.zir.nullTerminatedString(it.zir.extra[it.extra_index]);
|
||||
it.extra_index += 3; // name(1) + value(1) + doc_comment(1)
|
||||
it.extra_index += @as(u1, @truncate(flags >> 2));
|
||||
it.extra_index += @as(u1, @truncate(flags >> 3));
|
||||
it.extra_index += @as(u1, @truncate(flags >> 2)); // align
|
||||
it.extra_index += @as(u1, @truncate(flags >> 3)); // link_section
|
||||
it.extra_index += @as(u1, @truncate(flags >> 3)); // address_space
|
||||
|
||||
return Item{
|
||||
.sub_index = sub_index,
|
||||
|
@ -228,6 +228,7 @@ test {
|
||||
_ = @import("behavior/type.zig");
|
||||
_ = @import("behavior/type_info.zig");
|
||||
_ = @import("behavior/type_info_only_pub_decls.zig");
|
||||
_ = @import("behavior/type_info_mul_linksection_addrspace_decls.zig");
|
||||
_ = @import("behavior/typename.zig");
|
||||
_ = @import("behavior/undefined.zig");
|
||||
_ = @import("behavior/underscore.zig");
|
||||
|
12
test/behavior/type_info_mul_linksection_addrspace_decls.zig
Normal file
12
test/behavior/type_info_mul_linksection_addrspace_decls.zig
Normal file
@ -0,0 +1,12 @@
|
||||
const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
pub const a linksection("sec_a") = 0;
|
||||
pub const b linksection("sec_b") = 0;
|
||||
pub const c addrspace("space_c") = 0;
|
||||
pub const d addrspace("space_d") = 0;
|
||||
|
||||
test {
|
||||
const decls = @typeInfo(@This()).Struct.decls;
|
||||
try expect(decls.len == 4);
|
||||
}
|
Loading…
Reference in New Issue
Block a user