Skip to content

Commit b8c630d

Browse files
committed
BitcodeReader: parse blockinfo inside block
Call start/endBlock before/after `parseBlockInfoBlock` in order to not use the current block context, which is wrong and leads to e.g. incorrect blocklen being used.
1 parent 50edad3 commit b8c630d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/std/zig/llvm/BitcodeReader.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ pub fn next(bc: *BitcodeReader) !?Item {
154154
Abbrev.Builtin.enter_subblock.toRecordId() => {
155155
const block_id: u32 = @intCast(record.operands[0]);
156156
switch (block_id) {
157-
Block.block_info => try bc.parseBlockInfoBlock(),
157+
Block.block_info => {
158+
try bc.startBlock(Block.block_info, @intCast(record.operands[1]));
159+
try bc.parseBlockInfoBlock();
160+
try bc.endBlock();
161+
},
158162
Block.first_reserved...Block.last_standard => return error.UnsupportedBlockId,
159163
else => {
160164
try bc.startBlock(block_id, @intCast(record.operands[1]));

0 commit comments

Comments
 (0)