From 96ac99d3e9b12295b7e8a70888fd1134a78e63a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sun, 25 Nov 2018 08:11:52 +0100 Subject: Cover more code in beam_jump The previous optimizations caused some code in beam_jump to become uncovered. Add tests to cover more code. Also remove a clause in beam_jump:opt/3 that does not seem possible to cover anymore (this is safe, because the clause was an optimization). --- lib/compiler/src/beam_jump.erl | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'lib/compiler/src/beam_jump.erl') diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl index 57329338bf..8b0e3e32f8 100644 --- a/lib/compiler/src/beam_jump.erl +++ b/lib/compiler/src/beam_jump.erl @@ -429,16 +429,6 @@ opt([{test,_,{f,L}=Lbl,_}=I|[{jump,{f,L}}|_]=Is], Acc, St) -> %% as in the jump that follows -- thus it is not needed. opt(Is, Acc, St) end; -opt([{test,_,{f,L}=Lbl,_}=I|[{label,L}|_]=Is], Acc, St) -> - %% Similar to the above, except we have a fall-through rather than jump - %% Test Label Ops - %% label Label - case beam_utils:is_pure_test(I) of - false -> - opt(Is, [I|Acc], label_used(Lbl, St)); - true -> - opt(Is, Acc, St) - end; opt([{test,Test0,{f,L}=Lbl,Ops}=I|[{jump,To}|Is]=Is0], Acc, St) -> case is_label_defined(Is, L) of false -> -- cgit v1.2.3