File 0421-erts-Silence-stupid-CodeChecker-in-parse_match_opts_.patch of Package erlang
From 7e4f7f51db5d7e05ca1b47020abab7687a94cf07 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Tue, 9 Feb 2021 17:43:47 +0100
Subject: [PATCH 21/34] erts: Silence stupid CodeChecker in
parse_match_opts_list()
It thinks islist(l) can return true in "if" and then false in "while".
---
erts/emulator/beam/erl_bif_binary.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c
index dbc606505e..8d87f95f4b 100644
--- a/erts/emulator/beam/erl_bif_binary.c
+++ b/erts/emulator/beam/erl_bif_binary.c
@@ -1275,7 +1275,7 @@ static int parse_match_opts_list(Eterm l, Eterm bin, Uint *posp, Uint *endp)
*endp = binary_size(bin);
return 0;
} else if (is_list(l)) {
- while(is_list(l)) {
+ do {
Eterm t = CAR(list_val(l));
Uint orig_size;
if (!is_tuple(t)) {
@@ -1318,7 +1318,7 @@ static int parse_match_opts_list(Eterm l, Eterm bin, Uint *posp, Uint *endp)
goto badarg;
}
l = CDR(list_val(l));
- }
+ } while (is_list(l));
return 0;
} else {
badarg:
--
2.26.2