File 2221-compiler-tests-Properly-handle-multi-comprehensions.patch of Package erlang
From 612921de57554f50b0d2ff7c09e58a2c5d85afa9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 6 Feb 2026 09:55:29 +0100
Subject: [PATCH 1/2] compiler tests: Properly handle multi comprehensions
---
lib/compiler/test/beam_debug_info_SUITE.erl | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lib/compiler/test/beam_debug_info_SUITE.erl b/lib/compiler/test/beam_debug_info_SUITE.erl
index 8577a8f91e..c0ca01b22a 100644
--- a/lib/compiler/test/beam_debug_info_SUITE.erl
+++ b/lib/compiler/test/beam_debug_info_SUITE.erl
@@ -423,9 +423,9 @@ extract_src_vars({'catch',_Anno,E}, Lc, Acc0) ->
extract_src_vars({zip,_,Qs0}, _Lc, Acc0) ->
Qs = extract_sv_qs(Qs0),
extract_args(Qs, Acc0);
-extract_src_vars({C,_,Build,Qs0}, Lc, Acc0)
+extract_src_vars({C,_,Build0,Qs0}, Lc, Acc0)
when C =:= lc; C =:= bc; C =:= mc ->
- case any_debug_line_instrs(Build) of
+ case any_debug_line_instrs(Build0) of
false ->
Qs = extract_sv_qs(Qs0),
case any_debug_line_instrs(Qs) of
@@ -435,7 +435,13 @@ extract_src_vars({C,_,Build,Qs0}, Lc, Acc0)
extract_args(Qs, Acc0)
end;
true ->
- Acc1 = extract_src_vars(Build, Lc, Acc0),
+ Build = case Build0 of
+ [_|_] -> Build0;
+ _ -> [Build0]
+ end,
+ Acc1 = lists:foldl(fun(B, A) ->
+ extract_src_vars(B, Lc, A)
+ end, Acc0, Build),
extract_args(Qs0, Acc1)
end;
extract_src_vars({G,_,P,E}, _Lc, Acc0) ->
--
2.51.0