From 15ef8d67bc908a7939606468a5dda74188e65304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 28 Apr 2010 09:31:52 +0200 Subject: beam_bool: Remove a clause in live_regs/1 that cannot match live_regs/1 folds over a list of tuples, so a clause matching an element being an empty list can never match. If the list for some unfathomable reason would contain an empty list, there will be an internal compiler error and no *.beam file will be created. Thus this change is safe. --- lib/compiler/src/beam_bool.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/compiler/src/beam_bool.erl') diff --git a/lib/compiler/src/beam_bool.erl b/lib/compiler/src/beam_bool.erl index 3ea0a470a5..62bb97ec42 100644 --- a/lib/compiler/src/beam_bool.erl +++ b/lib/compiler/src/beam_bool.erl @@ -631,10 +631,10 @@ fetch_reg(V, [{I,V}|_]) -> {x,I}; fetch_reg(V, [_|SRs]) -> fetch_reg(V, SRs). live_regs(Regs) -> - foldl(fun ({I,_}, _) -> I; - ([], Max) -> Max end, - -1, Regs)+1. - + foldl(fun ({I,_}, _) -> + I + end, -1, Regs)+1. + %%% %%% Convert a block to Static Single Assignment (SSA) form. -- cgit v1.2.3