aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_bool.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-04-28 09:31:52 +0200
committerRaimo Niskanen <[email protected]>2010-05-20 12:20:50 +0200
commit15ef8d67bc908a7939606468a5dda74188e65304 (patch)
treecd7de1ba11f88361b4428983138080ad8f8f02a1 /lib/compiler/src/beam_bool.erl
parentd60ee77c2b152b89e057ffebe0694c21700c82ce (diff)
downloadotp-15ef8d67bc908a7939606468a5dda74188e65304.tar.gz
otp-15ef8d67bc908a7939606468a5dda74188e65304.tar.bz2
otp-15ef8d67bc908a7939606468a5dda74188e65304.zip
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.
Diffstat (limited to 'lib/compiler/src/beam_bool.erl')
-rw-r--r--lib/compiler/src/beam_bool.erl8
1 files changed, 4 insertions, 4 deletions
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.