diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/branch-utils.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir/branch-utils.h b/src/ir/branch-utils.h index be3f7f7a8..369365e72 100644 --- a/src/ir/branch-utils.h +++ b/src/ir/branch-utils.h @@ -108,7 +108,8 @@ void operateOnScopeNameUsesAndSentValues(Expression* expr, T func) { } else if (auto* sw = expr->dynCast<Switch>()) { func(name, sw->value); } else if (auto* br = expr->dynCast<BrOn>()) { - func(name, br->ref); + // A value may not be sent (e.g. BrOnNull does *not* send a null). + func(name, br->getSentType() != Type::none ? br->ref : nullptr); } else if (expr->is<TryTable>()) { // The values are supplied by throwing instructions, so we are unable to // know what they will be here. |