aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src/add_abstract_code
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-08-30 21:00:35 +0200
committerSverker Eriksson <[email protected]>2017-08-30 21:00:35 +0200
commit44a83c8860bbd00878c720a7b9d940b4630bab8a (patch)
tree101b3c52ec505a94f56c8f70e078ecb8a2e8c6cd /erts/preloaded/src/add_abstract_code
parent7c67bbddb53c364086f66260701bc54a61c9659c (diff)
parent040bdce67f88d833bfb59adae130a4ffb4c180f0 (diff)
downloadotp-44a83c8860bbd00878c720a7b9d940b4630bab8a.tar.gz
otp-44a83c8860bbd00878c720a7b9d940b4630bab8a.tar.bz2
otp-44a83c8860bbd00878c720a7b9d940b4630bab8a.zip
Merge tag 'OTP-20.0' into sverker/20/binary_to_atom-utf8-crash/ERL-474/OTP-14590
Diffstat (limited to 'erts/preloaded/src/add_abstract_code')
-rw-r--r--erts/preloaded/src/add_abstract_code16
1 files changed, 8 insertions, 8 deletions
diff --git a/erts/preloaded/src/add_abstract_code b/erts/preloaded/src/add_abstract_code
index 943987872e..9040199417 100644
--- a/erts/preloaded/src/add_abstract_code
+++ b/erts/preloaded/src/add_abstract_code
@@ -4,7 +4,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,12 +28,12 @@
main([BeamFile,AbstrFile]) ->
{ok,_,Chunks0} = beam_lib:all_chunks(BeamFile),
{ok,Abstr} = file:consult(AbstrFile),
- Chunks1 = lists:keyreplace("Abst", 1, Chunks0,
- {"Abst",term_to_binary({raw_abstract_v1,Abstr})}),
- {"CInf",CInf0} = lists:keyfind("CInf", 1, Chunks1),
- CInf = fix_options(CInf0),
- Chunks = lists:keyreplace("CInf", 1, Chunks1, {"CInf",CInf}),
- {ok,Module} = beam_lib:build_module(Chunks),
+ {"CInf",CInf0} = lists:keyfind("CInf", 1, Chunks0),
+ {CInf, COpts} = fix_options(CInf0),
+ Chunks1 = lists:keyreplace("CInf", 1, Chunks0, {"CInf",CInf}),
+ Chunks2 = lists:keyreplace("Dbgi", 1, Chunks1,
+ {"Dbgi",term_to_binary({debug_info_v1,erl_abstract_code,{Abstr, COpts}})}),
+ {ok,Module} = beam_lib:build_module(Chunks2),
ok = file:write_file(BeamFile, Module),
init:stop().
@@ -42,4 +42,4 @@ fix_options(CInf0) ->
{options,Opts0} = lists:keyfind(options, 1, CInf1),
Opts = Opts0 -- [from_asm],
CInf = lists:keyreplace(options, 1, CInf1, {options,Opts}),
- term_to_binary(CInf).
+ {term_to_binary(CInf), Opts}.