diff options
author | Richard Carlsson <[email protected]> | 2015-04-26 16:29:53 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-06-10 15:56:56 +0200 |
commit | 3219822bb549a9d0d40ff29463f0bfe7d1eedd37 (patch) | |
tree | d19b0294cc422e689356a598dc858e601a6c5283 /erts/emulator/test/module_info_SUITE_data/module_info_test.erl | |
parent | d8f343b234174d49bc66d5bddbe79f24400868e6 (diff) | |
download | otp-3219822bb549a9d0d40ff29463f0bfe7d1eedd37.tar.gz otp-3219822bb549a9d0d40ff29463f0bfe7d1eedd37.tar.bz2 otp-3219822bb549a9d0d40ff29463f0bfe7d1eedd37.zip |
Fix segfault in module_info for deleted modules
Add a check to protect from segfault when erlang:get_module_info/1/2 is
called on a deleted module (i.e. with no current code). Also refactor
erts_module_info_0/1 to avoid repeated calls to erts_active_code_ix() and
remove some obsolete comments. Add test for module_info on deleted modules.
Diffstat (limited to 'erts/emulator/test/module_info_SUITE_data/module_info_test.erl')
-rw-r--r-- | erts/emulator/test/module_info_SUITE_data/module_info_test.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/erts/emulator/test/module_info_SUITE_data/module_info_test.erl b/erts/emulator/test/module_info_SUITE_data/module_info_test.erl new file mode 100644 index 0000000000..f045f38464 --- /dev/null +++ b/erts/emulator/test/module_info_SUITE_data/module_info_test.erl @@ -0,0 +1,24 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2015. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(module_info_test). +-export([f/0]). + +f() -> + 17. |