aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/beam_lib.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-02-18 09:58:34 +0100
committerHans Bolinder <[email protected]>2016-02-19 08:37:05 +0100
commit47fae67ce44af1d6e65f59061bff9d799e8f86f5 (patch)
tree73ce5d153d7c1e4996756c6874191bdda5ac81a9 /lib/stdlib/src/beam_lib.erl
parent2fc3f4c31ee71174ccf3478553a236a486e542c0 (diff)
downloadotp-47fae67ce44af1d6e65f59061bff9d799e8f86f5.tar.gz
otp-47fae67ce44af1d6e65f59061bff9d799e8f86f5.tar.bz2
otp-47fae67ce44af1d6e65f59061bff9d799e8f86f5.zip
stdlib: Let beam_lib restore typed record forms
Forms with record field types created before OTP 19.0 are replaced by well-formed record forms holding the type information. Tools reading the 'abstract_code' chunk can rely on the returned forms being well-formed, that is, there are no badly formed 'type' attribute forms.
Diffstat (limited to 'lib/stdlib/src/beam_lib.erl')
-rw-r--r--lib/stdlib/src/beam_lib.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl
index 00cd1221fa..7a17226e46 100644
--- a/lib/stdlib/src/beam_lib.erl
+++ b/lib/stdlib/src/beam_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. 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.
@@ -904,7 +904,11 @@ anno_from_term({Tag, Forms}) when Tag =:= abstract_v1; Tag =:= abstract_v2 ->
anno_from_term(T) ->
T.
-anno_from_forms(Forms) ->
+anno_from_forms(Forms0) ->
+ %% Forms with record field types created before OTP 19.0 are
+ %% replaced by well-formed record forms holding the type
+ %% information.
+ Forms = epp:restore_typed_record_fields(Forms0),
[erl_parse:anno_from_term(Form) || Form <- Forms].
start_crypto() ->