diff options
| author | Veikka Tuominen <git@vexu.eu> | 2021-06-07 23:49:28 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-06-08 10:15:34 +0300 |
| commit | d41a5105cd6222564dfe6bad9cff2c445847c6b3 (patch) | |
| tree | c62fb79d125919a206a6087d060802d70a1b504a /src/Sema.zig | |
| parent | 7efd7bc3b8cc403814c0aa62be0a17ff25b33902 (diff) | |
| download | zig-d41a5105cd6222564dfe6bad9cff2c445847c6b3.tar.gz zig-d41a5105cd6222564dfe6bad9cff2c445847c6b3.zip | |
stage2: fix repeat_inline skipping first instruction in block
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index ea5a0e377a..6145b8c137 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -147,7 +147,7 @@ pub fn analyzeBody( // directly jump to the next one, rather than detouring through the loop // continue expression. Related: https://github.com/ziglang/zig/issues/8220 var i: usize = 0; - while (true) : (i += 1) { + while (true) { const inst = body[i]; const air_inst = switch (tags[inst]) { // zig fmt: off @@ -394,78 +394,97 @@ pub fn analyzeBody( // putting them into the map. .breakpoint => { try sema.zirBreakpoint(block, inst); + i += 1; continue; }, .fence => { try sema.zirFence(block, inst); + i += 1; continue; }, .dbg_stmt => { try sema.zirDbgStmt(block, inst); + i += 1; continue; }, .ensure_err_payload_void => { try sema.zirEnsureErrPayloadVoid(block, inst); + i += 1; continue; }, .ensure_result_non_error => { try sema.zirEnsureResultNonError(block, inst); + i += 1; continue; }, .ensure_result_used => { try sema.zirEnsureResultUsed(block, inst); + i += 1; continue; }, .set_eval_branch_quota => { try sema.zirSetEvalBranchQuota(block, inst); + i += 1; continue; }, .store => { try sema.zirStore(block, inst); + i += 1; continue; }, .store_node => { try sema.zirStoreNode(block, inst); + i += 1; continue; }, .store_to_block_ptr => { try sema.zirStoreToBlockPtr(block, inst); + i += 1; continue; }, .store_to_inferred_ptr => { try sema.zirStoreToInferredPtr(block, inst); + i += 1; continue; }, .resolve_inferred_alloc => { try sema.zirResolveInferredAlloc(block, inst); + i += 1; continue; }, .validate_struct_init_ptr => { try sema.zirValidateStructInitPtr(block, inst); + i += 1; continue; }, .validate_array_init_ptr => { try sema.zirValidateArrayInitPtr(block, inst); + i += 1; continue; }, .@"export" => { try sema.zirExport(block, inst); + i += 1; continue; }, .set_align_stack => { try sema.zirSetAlignStack(block, inst); + i += 1; continue; }, .set_cold => { try sema.zirSetAlignStack(block, inst); + i += 1; continue; }, .set_float_mode => { try sema.zirSetFloatMode(block, inst); + i += 1; continue; }, .set_runtime_safety => { try sema.zirSetRuntimeSafety(block, inst); + i += 1; continue; }, @@ -510,6 +529,7 @@ pub fn analyzeBody( if (air_inst.ty.isNoReturn()) return always_noreturn; try map.put(sema.gpa, inst, air_inst); + i += 1; } } |
