aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_codeserver.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2019-02-05 15:12:24 +0100
committerHans Bolinder <[email protected]>2019-02-06 10:06:57 +0100
commit0d0799b4971e3353943614a311502cd4dd7b3ec9 (patch)
treee99a9a5d71a51c0a45ced37cead076e6cfc29bfa /lib/dialyzer/src/dialyzer_codeserver.erl
parentc2126443b79aa53c9fc04e7dad4e6c717ca6986b (diff)
downloadotp-0d0799b4971e3353943614a311502cd4dd7b3ec9.tar.gz
otp-0d0799b4971e3353943614a311502cd4dd7b3ec9.tar.bz2
otp-0d0799b4971e3353943614a311502cd4dd7b3ec9.zip
dialyzer: Fix a bug regarding contracts
See also https://bugs.erlang.org/browse/ERL-845. Fix a bug that caused Dialyzer to crash when analyzing a contract with a module name differing from the analyzed module's name. The bug was introduced in Erlang/OTP 18.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_codeserver.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_codeserver.erl8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/dialyzer/src/dialyzer_codeserver.erl b/lib/dialyzer/src/dialyzer_codeserver.erl
index 5587cf2bdf..c4e3c322e5 100644
--- a/lib/dialyzer/src/dialyzer_codeserver.erl
+++ b/lib/dialyzer/src/dialyzer_codeserver.erl
@@ -347,13 +347,11 @@ get_file_contract(Key, ContDict) ->
lookup_mfa_contract(MFA, #codeserver{contracts = ContDict}) ->
ets_dict_find(MFA, ContDict).
--spec lookup_meta_info(module() | mfa(), codeserver()) -> meta_info().
+-spec lookup_meta_info(module() | mfa(), codeserver()) ->
+ {'ok', meta_info()} | 'error'.
lookup_meta_info(MorMFA, #codeserver{fun_meta_info = FunMetaInfo}) ->
- case ets_dict_find(MorMFA, FunMetaInfo) of
- error -> [];
- {ok, PropList} -> PropList
- end.
+ ets_dict_find(MorMFA, FunMetaInfo).
-spec get_contracts(codeserver()) ->
dict:dict(mfa(), dialyzer_contracts:file_contract()).