diff options
author | Hans Bolinder <hasse@erlang.org> | 2016-02-18 09:58:34 +0100 |
---|---|---|
committer | Hans Bolinder <hasse@erlang.org> | 2016-02-19 08:37:05 +0100 |
commit | 47fae67ce44af1d6e65f59061bff9d799e8f86f5 (patch) | |
tree | 73ce5d153d7c1e4996756c6874191bdda5ac81a9 /lib/stdlib/src | |
parent | 2fc3f4c31ee71174ccf3478553a236a486e542c0 (diff) | |
download | otp-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')
-rw-r--r-- | lib/stdlib/src/beam_lib.erl | 8 |
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() -> |