diff options
author | Frej Drejhammar <frej.drejhammar@gmail.com> | 2020-10-12 12:54:05 +0200 |
---|---|---|
committer | Frej Drejhammar <frej.drejhammar@gmail.com> | 2020-10-13 09:39:11 +0200 |
commit | b9e9d6e8dd3b789dcf341d3b9b6e06c52eb01856 (patch) | |
tree | 36fe0456dd31d104c8cb0a6e1bb63e6e79c2b11f /scripts/diffable | |
parent | 4007345c98213da536e629461343aa3648f52000 (diff) | |
download | erlang-b9e9d6e8dd3b789dcf341d3b9b6e06c52eb01856.tar.gz |
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.
Diffstat (limited to 'scripts/diffable')
-rwxr-xr-x | scripts/diffable | 6 |
1 files 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, |