aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-11-27 08:36:06 +0100
committerBjörn Gustavsson <[email protected]>2017-11-27 10:24:20 +0100
commitf5891aa400e79da544693e8b0282438896f599fd (patch)
treec4d7356885f3bbd323c989c17fbbdfe10ae6e41a /lib
parent16cf9a166fe2929e30dc59266a8b82a11ef84739 (diff)
downloadotp-f5891aa400e79da544693e8b0282438896f599fd.tar.gz
otp-f5891aa400e79da544693e8b0282438896f599fd.tar.bz2
otp-f5891aa400e79da544693e8b0282438896f599fd.zip
beam_asm: No longer allow iolists as contents in chunk/2
The clause that converted an iolist to a binary was never executed. Note that chunk/2 is called for all chunks in the {extra_chunks,Chunks} option. This change will enforce that the contents of each chunk must be a binary (as documented).
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/src/beam_asm.erl4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_asm.erl b/lib/compiler/src/beam_asm.erl
index 9ecbb7884c..3dff51d7f6 100644
--- a/lib/compiler/src/beam_asm.erl
+++ b/lib/compiler/src/beam_asm.erl
@@ -240,9 +240,7 @@ build_form(Id, Chunks0) when byte_size(Id) =:= 4, is_list(Chunks0) ->
chunk(Id, Contents) when byte_size(Id) =:= 4, is_binary(Contents) ->
Size = byte_size(Contents),
- [<<Id/binary,Size:32>>,Contents|pad(Size)];
-chunk(Id, Contents) when is_list(Contents) ->
- chunk(Id, list_to_binary(Contents)).
+ [<<Id/binary,Size:32>>,Contents|pad(Size)].
%% Build a correctly padded chunk (with a sub-header).