File 0134-diffable-Fix-bug-in-rejoin_atoms-1.patch of Package erlang
From b9e9d6e8dd3b789dcf341d3b9b6e06c52eb01856 Mon Sep 17 00:00:00 2001
From: Frej Drejhammar <frej.drejhammar@gmail.com>
Date: Mon, 12 Oct 2020 12:54:05 +0200
Subject: [PATCH 1/2] diffable: Fix bug in rejoin_atoms/1
The beam-assembly dump parser in diffable does not parse atoms
containing spaces correctly, leading to, for example, the atom 'foo
bar' to be considered to be two operands. Diffable compensates for
this parser particularity, when important for the correct functioning
of diffable, by using rejoin_atoms/1 to merge split atoms in the
operand list.
This patch fixes a bug in rejoin_atoms/1 where the attempted merging
would stop as soon as a non-atom operand was found.
---
scripts/diffable | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/diffable b/scripts/diffable
index acd7419471..c4f80da87a 100755
--- a/scripts/diffable
+++ b/scripts/diffable
@@ -537,8 +537,10 @@ rejoin_atoms([<<"'",Tail/binary>> = Bin0,Next|Ops]) ->
Bin = <<Bin0/binary,$\s,Next/binary>>,
rejoin_atoms([Bin|Ops])
end;
-rejoin_atoms(Ops) ->
- Ops.
+rejoin_atoms([Op|Ops]) ->
+ [Op|rejoin_atoms(Ops)];
+rejoin_atoms([]) ->
+ [].
find_labels(Is, Name, Arity) ->
[_,[Entry|_]|_] = Is,
--
2.26.2