aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_asm.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-03-24 15:45:50 +0100
committerBjörn Gustavsson <[email protected]>2016-03-24 15:45:50 +0100
commit443dd5970f321f427b5fd65fcb3f630741a4197f (patch)
tree353766fcd9ff20211553c79ac66bc4460614bf21 /lib/compiler/src/beam_asm.erl
parentab418313123e98d5de15e2e71ac169afdad8d3f8 (diff)
parentafff8b0fd74fda09ba8dc5f7bfe95b5cb345872e (diff)
downloadotp-443dd5970f321f427b5fd65fcb3f630741a4197f.tar.gz
otp-443dd5970f321f427b5fd65fcb3f630741a4197f.tar.bz2
otp-443dd5970f321f427b5fd65fcb3f630741a4197f.zip
Merge branch 'bjorn/compiler/forms/ERL-113/OTP-13430'
* bjorn/compiler/forms/ERL-113/OTP-13430: Fix compile:forms/1,2 crash when not in an existing directory
Diffstat (limited to 'lib/compiler/src/beam_asm.erl')
-rw-r--r--lib/compiler/src/beam_asm.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_asm.erl b/lib/compiler/src/beam_asm.erl
index 95be471de3..28fd061bdc 100644
--- a/lib/compiler/src/beam_asm.erl
+++ b/lib/compiler/src/beam_asm.erl
@@ -225,10 +225,14 @@ flatten_imports(Imps) ->
list_to_binary(map(fun({M,F,A}) -> <<M:32,F:32,A:32>> end, Imps)).
build_attributes(Opts, SourceFile, Attr, MD5) ->
+ Misc0 = case SourceFile of
+ [] -> [];
+ [_|_] -> [{source,SourceFile}]
+ end,
Misc = case member(slim, Opts) of
false ->
{{Y,Mo,D},{H,Mi,S}} = erlang:universaltime(),
- [{time,{Y,Mo,D,H,Mi,S}},{source,SourceFile}];
+ [{time,{Y,Mo,D,H,Mi,S}}|Misc0];
true -> []
end,
Compile = [{options,Opts},{version,?COMPILER_VSN}|Misc],