aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/beam_validator_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-05-23 09:38:23 +0200
committerBjörn Gustavsson <[email protected]>2017-05-23 10:35:31 +0200
commit7336c17119f424b6356f2ec2b670994cb462570e (patch)
tree8877cd0e60eef6c618c8c184487beffa76c7a4c8 /lib/compiler/test/beam_validator_SUITE.erl
parentdfbefdcc85b2785e4d2280c1b70de8fd14a6778d (diff)
downloadotp-7336c17119f424b6356f2ec2b670994cb462570e.tar.gz
otp-7336c17119f424b6356f2ec2b670994cb462570e.tar.bz2
otp-7336c17119f424b6356f2ec2b670994cb462570e.zip
Correct handling of module name in compile:forms/1,2
compile:forms/1,2 is documented to return: {ok,ModuleName,BinaryOrCode} However, if one of the options 'from_core', 'from_asm', or 'from_beam' is given, ModuleName will be returned as []. A worse problem is that is that if one those options are combined with the 'native' option, compilation will crash. Correct compile:forms/1,2 to pick up the module name from the forms provided (either Core Erlang, Beam assembly code, or a Beam file). Reported here: https://bugs.erlang.org/browse/ERL-417
Diffstat (limited to 'lib/compiler/test/beam_validator_SUITE.erl')
-rw-r--r--lib/compiler/test/beam_validator_SUITE.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl
index ca85eef688..75bfbf68cc 100644
--- a/lib/compiler/test/beam_validator_SUITE.erl
+++ b/lib/compiler/test/beam_validator_SUITE.erl
@@ -446,7 +446,7 @@ do_bin_opt(Mod, Asm) ->
do_bin_opt(Transform, Mod, Asm0) ->
Asm = Transform(Asm0),
case compile:forms(Asm, [from_asm,no_postopt,return]) of
- {ok,[],Code,_Warnings} when is_binary(Code) ->
+ {ok,Mod,Code,_Warnings} when is_binary(Code) ->
ok;
{error,Errors0,_} ->
%% beam_validator must return errors, not simply crash,