diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-31 01:31:23 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-31 01:31:23 -0500 |
| commit | 76fa6cdce36671bd9ad54248d77a3941f2eb3e34 (patch) | |
| tree | 85595ca0bb300121c12544cb401eac4f43054ff0 /src | |
| parent | 29bb175f4f9018bfb0e17686c05165527530de25 (diff) | |
| download | zig-76fa6cdce36671bd9ad54248d77a3941f2eb3e34.tar.gz zig-76fa6cdce36671bd9ad54248d77a3941f2eb3e34.zip | |
eradicate use of zeroes in std
Diffstat (limited to 'src')
| -rw-r--r-- | src/all_types.hpp | 2 | ||||
| -rw-r--r-- | src/ir.cpp | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp index 9f470996f3..ef6e2ae654 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -1382,7 +1382,7 @@ enum AtomicOrder { // A basic block contains no branching. Branches send control flow // to another basic block. // Phi instructions must be first in a basic block. -// The last instruction in a basic block must be an expression of type unreachable. +// The last instruction in a basic block must be of type unreachable. struct IrBasicBlock { ZigList<IrInstruction *> instruction_list; IrBasicBlock *other; diff --git a/src/ir.cpp b/src/ir.cpp index edb2789c5d..33bfb0fe9f 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -2741,10 +2741,11 @@ static void ir_count_defers(IrBuilder *irb, Scope *inner_scope, Scope *outer_sco static void ir_gen_defers_for_block(IrBuilder *irb, Scope *inner_scope, Scope *outer_scope, bool gen_error_defers, bool gen_maybe_defers) { - while (inner_scope != outer_scope) { - assert(inner_scope); - if (inner_scope->id == ScopeIdDefer) { - AstNode *defer_node = inner_scope->source_node; + Scope *scope = inner_scope; + while (scope != outer_scope) { + assert(scope); + if (scope->id == ScopeIdDefer) { + AstNode *defer_node = scope->source_node; assert(defer_node->type == NodeTypeDefer); ReturnKind defer_kind = defer_node->data.defer.kind; if (defer_kind == ReturnKindUnconditional || @@ -2756,7 +2757,7 @@ static void ir_gen_defers_for_block(IrBuilder *irb, Scope *inner_scope, Scope *o } } - inner_scope = inner_scope->parent; + scope = scope->parent; } } |
