From 0b474843f999a6fb82ebd34819c83f56039d2ada Mon Sep 17 00:00:00 2001 From: Ulf Norell Date: Sat, 16 Nov 2019 10:18:40 +0100 Subject: [PATCH] Protect against ill-typed code --- src/aeso_fcode_to_fate.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aeso_fcode_to_fate.erl b/src/aeso_fcode_to_fate.erl index 48a326c..6eb0de9 100644 --- a/src/aeso_fcode_to_fate.erl +++ b/src/aeso_fcode_to_fate.erl @@ -1141,7 +1141,7 @@ r_prune_impossible_branches({switch, ?i(V), boolean, [False, True] = Alts, Def}, end end; r_prune_impossible_branches(Variant = {i, _, {'VARIANT', R, ?i(_), ?i(Tag), ?i(_)}}, - [{switch, R, Type = {variant, _}, Alts, missing} | Code]) -> + [{switch, R, Type = {variant, _}, Alts, missing} | Code]) when is_integer(Tag) -> case {R, lists:nth(Tag + 1, Alts)} of {_, missing} -> Alts1 = [missing || _ <- Alts],