| ... | @@ -2129,7 +2129,15 @@ fn walkInstruction( | ... | @@ -2129,7 +2129,15 @@ fn walkInstruction( |
| 2129 | file, | 2129 | file, |
| 2130 | parent_scope, | 2130 | parent_scope, |
| 2131 | parent_src, | 2131 | parent_src, |
| 2132 | getBlockInlineBreak(file.zir, inst_index), | 2132 | getBlockInlineBreak(file.zir, inst_index) orelse { |
| | 2133 | const res = DocData.WalkResult{ .expr = .{ |
| | 2134 | .comptimeExpr = self.comptime_exprs.items.len, |
| | 2135 | } }; |
| | 2136 | try self.comptime_exprs.append(self.arena, .{ |
| | 2137 | .code = "if (...) { ... }", |
| | 2138 | }); |
| | 2139 | return res; |
| | 2140 | }, |
| 2133 | need_type, | 2141 | need_type, |
| 2134 | ); | 2142 | ); |
| 2135 | }, | 2143 | }, |
| ... | @@ -3155,7 +3163,7 @@ fn walkDecls( | ... | @@ -3155,7 +3163,7 @@ fn walkDecls( |
| 3155 | 2 => { | 3163 | 2 => { |
| 3156 | // decl test | 3164 | // decl test |
| 3157 | const decl_being_tested = scope.resolveDeclName(doc_comment_index); | 3165 | const decl_being_tested = scope.resolveDeclName(doc_comment_index); |
| 3158 | const func_index = getBlockInlineBreak(file.zir, value_index); | 3166 | const func_index = getBlockInlineBreak(file.zir, value_index).?; |
| 3159 | | 3167 | |
| 3160 | const pl_node = data[Zir.refToIndex(func_index).?].pl_node; | 3168 | const pl_node = data[Zir.refToIndex(func_index).?].pl_node; |
| 3161 | const fn_src = try self.srcLocInfo(file, pl_node.src_node, decl_src); | 3169 | const fn_src = try self.srcLocInfo(file, pl_node.src_node, decl_src); |
| ... | @@ -4301,12 +4309,13 @@ fn walkRef( | ... | @@ -4301,12 +4309,13 @@ fn walkRef( |
| 4301 | } | 4309 | } |
| 4302 | } | 4310 | } |
| 4303 | | 4311 | |
| 4304 | fn getBlockInlineBreak(zir: Zir, inst_index: usize) Zir.Inst.Ref { | 4312 | fn getBlockInlineBreak(zir: Zir, inst_index: usize) ?Zir.Inst.Ref { |
| 4305 | const tags = zir.instructions.items(.tag); | 4313 | const tags = zir.instructions.items(.tag); |
| 4306 | const data = zir.instructions.items(.data); | 4314 | const data = zir.instructions.items(.data); |
| 4307 | const pl_node = data[inst_index].pl_node; | 4315 | const pl_node = data[inst_index].pl_node; |
| 4308 | const extra = zir.extraData(Zir.Inst.Block, pl_node.payload_index); | 4316 | const extra = zir.extraData(Zir.Inst.Block, pl_node.payload_index); |
| 4309 | const break_index = zir.extra[extra.end..][extra.data.body_len - 1]; | 4317 | const break_index = zir.extra[extra.end..][extra.data.body_len - 1]; |
| | 4318 | if (tags[break_index] == .condbr_inline) return null; |
| 4310 | std.debug.assert(tags[break_index] == .break_inline); | 4319 | std.debug.assert(tags[break_index] == .break_inline); |
| 4311 | return data[break_index].@"break".operand; | 4320 | return data[break_index].@"break".operand; |
| 4312 | } | 4321 | } |