| ... | @@ -940,6 +940,15 @@ pub fn analyzeBody( | ... | @@ -940,6 +940,15 @@ pub fn analyzeBody( |
| 940 | const inst_data = datas[inst].pl_node; | 940 | const inst_data = datas[inst].pl_node; |
| 941 | const extra = sema.code.extraData(Zir.Inst.Block, inst_data.payload_index); | 941 | const extra = sema.code.extraData(Zir.Inst.Block, inst_data.payload_index); |
| 942 | const inline_body = sema.code.extra[extra.end..][0..extra.data.body_len]; | 942 | const inline_body = sema.code.extra[extra.end..][0..extra.data.body_len]; |
| | 943 | // If this block contains a function prototype, we need to reset the |
| | 944 | // current list of parameters and restore it later. |
| | 945 | // Note: this probably needs to be resolved in a more general manner. |
| | 946 | const prev_params = block.params; |
| | 947 | block.params = .{}; |
| | 948 | defer { |
| | 949 | block.params.deinit(sema.gpa); |
| | 950 | block.params = prev_params; |
| | 951 | } |
| 943 | const break_inst = try sema.analyzeBody(block, inline_body); | 952 | const break_inst = try sema.analyzeBody(block, inline_body); |
| 944 | const break_data = datas[break_inst].@"break"; | 953 | const break_data = datas[break_inst].@"break"; |
| 945 | if (inst == break_data.block_inst) { | 954 | if (inst == break_data.block_inst) { |
| ... | @@ -953,6 +962,15 @@ pub fn analyzeBody( | ... | @@ -953,6 +962,15 @@ pub fn analyzeBody( |
| 953 | const inst_data = datas[inst].pl_node; | 962 | const inst_data = datas[inst].pl_node; |
| 954 | const extra = sema.code.extraData(Zir.Inst.Block, inst_data.payload_index); | 963 | const extra = sema.code.extraData(Zir.Inst.Block, inst_data.payload_index); |
| 955 | const inline_body = sema.code.extra[extra.end..][0..extra.data.body_len]; | 964 | const inline_body = sema.code.extra[extra.end..][0..extra.data.body_len]; |
| | 965 | // If this block contains a function prototype, we need to reset the |
| | 966 | // current list of parameters and restore it later. |
| | 967 | // Note: this probably needs to be resolved in a more general manner. |
| | 968 | const prev_params = block.params; |
| | 969 | block.params = .{}; |
| | 970 | defer { |
| | 971 | block.params.deinit(sema.gpa); |
| | 972 | block.params = prev_params; |
| | 973 | } |
| 956 | const break_inst = try sema.analyzeBody(block, inline_body); | 974 | const break_inst = try sema.analyzeBody(block, inline_body); |
| 957 | const break_data = datas[break_inst].@"break"; | 975 | const break_data = datas[break_inst].@"break"; |
| 958 | if (inst == break_data.block_inst) { | 976 | if (inst == break_data.block_inst) { |