Age | Commit message (Collapse) | Author |
|
See also https://bugs.erlang.org/browse/ERL-953.
|
|
* hasse/dialyzer/prettier_warnings/OTP-15135:
dialyzer: Remove quotes around operators
dialyzer: Add test cases with indentation
dialyzer: Add an --no_indentation option
dialyzer: Add parentheses around annotated union elements
dialyzer: Fix dialyzer_dataflow:format_args_1()
|
|
|
|
A smallish selection of already existing tests, run with
the indentation option.
|
|
By default Dialyzer tries to improve the readability of warnings.
Newlines are inserted before and inside types, signatures, and Erlang
code. Sometimes the newlines look misplaced. The raw format
(option --raw) is not affected.
Use the new --no_indentation option get the old behavior (no inserted
line breaks).
A note on the implementation. The types &c present in the warning
tuples are parsed, and then formatted using erl_pp, the Erlang Pretty
Printer. The alternative, to create message tuples with formatted
types, turned out to more complicated, and has no real benefits.
Also notice that the fixes for binaries (commit 9db8a098) and union
elements (commit a1e51d12) are required. As a consequence, messages
created before these commits using the --raw option cannot always be
indented.
|
|
See also https://bugs.erlang.org/browse/ERL-845.
[Kostis:]
My suggestion is that the compiler refuses to compile modules that
contain specs for functions that are not from this module. I do not
remember when / why this `feature' was introduced, but thinking about
it I see a lot of (ugly) semantics issues with it. For example, should
one be allowed to declare in the foo module that lists:flatten/1 takes
an integer() as an argument and returns a binary()? Should one be
allowed to declare a spec in some module m1 for a function of m2 that
is not defined in m2?
There are all kinds of checks that will need to be added to dialyzer
to protect itself from these semantics issues. The compiler already
refuses to compile modules that contain specs for non-existing
functions of the module. Similarly, it should refuse to compile
modules that contain specs for functions of other modules - unless it
can somehow check that these functions are indeed defined, but it is
not how the compiler currently works.
|
|
In contracts, annotated elements of unions are printed with
parentheses around them. They are not parseable otherwise.
|
|
|
|
The mismatching argument positions are included.
|
|
* hasse/dialyzer/improve_binary_printing/OTP-15752:
dialyzer: Fix pretty printing of binaries
|
|
Fix various spelling mistakes
|
|
Notice the comment in dialyzer_utils:
%% Copied from core_pp. The function cerl:binary_segments/2 should/could
%% be extended to handle literals, but then the cerl module cannot be
%% HiPE-compiled as of Erlang/OTP 22.0 (due to <<I:N>>).
When at it: simplify some common cases like "/binary-unit:8".
|
|
Fix ERL-541 and various other unreported spelling mistakes.
|
|
* maint:
dialyzer: Fix maps as parameter of opaque types
dialyzer: Fix key check of lists:key{search,member,find}()
|
|
The clause added for maps in commit 1a7c41be is corrected.
|
|
Replace integers and floats with t_number() since keysearch et al
compare the key (rather than match).
Corrects the commit b3c8e94.
|
|
* maint:
dialyzer: Fix a bug regarding contracts
|
|
* hasse/dialyzer/fix_contract_check/OTP-15562/ERL-845:
dialyzer: Fix a bug regarding contracts
|
|
* maint:
dialyzer: Fix a bug affecting keyfind/keysearch/keymember
|
|
|
|
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.
|
|
uabboli/hasse/dialyzer/improve_guards/OTP-15268/ERL-680
dialyzer: Improve handling of complex guards
|
|
See also https://bugs.erlang.org/browse/ERL-680.
The right associative short circuit expressions 'andalso' and 'orelse'
are expanded by the Compiler (see v3_core) into 'case' expressions. If
parentheses are used to enforce left associativeness, variables are
introduced, and the time needed by Dialyzer increases exponentially.
Rather than trying to fix Dialyzer itself, v3_core now rewrites
repeated use of 'andalso' ('orelse') into right associative
expressions before creating the 'case' expressions.
|
|
I did not find any legitimate use of "can not", however skipped
changing e.g RFCs archived in the source tree.
|
|
This only touches functions that are not further manually enhanced in
erl_bif_types. The hope is that this will allow dialyzer to discover
more issues in code using maps.
|
|
See also https://bugs.erlang.org/browse/ERL-634.
The utility program `erl_call' in erl_interface used to call
lib:eval_str/1, which is no longer present in Erlang/OTP 21.0.
The lib module was eliminated in OTP-15072, see also
https://github.com/erlang/otp/pull/1786.
|
|
The -Woverspecs (-Wspecdiffs) option generates warnings in a few more
cases. The refinement is analogous to the test that -Wunderspecs
already does: it checks if the contract has nothing in common with
some element (see erl_types:t_elements/1) of the success typing.
|
|
* hasse/dialyzer/funs_in_dead_code/OTP-15079/ERL-593:
dialyzer: Do not emit warnings for unreachable funs
|
|
Warnings are not generated for funs residing in dead code.
In particular, warnings like "The created fun has no local return" are
no longer generated for funs declared in clauses or functions that
cannot be run.
|
|
|
|
|
|
|
|
|
|
Use integer variable names instead of atoms in v3_core, sys_core_fold,
and v3_kernel to avoid overflowing the atom table.
It is a deliberate design decision to calculate the first free integer
variable name (in sys_core_fold and v3_kernel) instead of somehow
passing it from one pass to another. I don't want that kind of
dependency between compiler passes. Also note that the next free
variable name is not easily available after running the inliner.
|
|
make erlang:process_info/1 not retrieve messages
|
|
* hasse/dialyzer/extra-range/OTP-14970:
ssl: Correct some specs
os_mon: Correct a spec
Fix broken spec in beam_asm
Dialyzer should not throw away spec information because of overspec
|
|
process_info/1 retrieves a number of properties related to a process,
including the list of messages in its mailbox. This is potentially
unsafe if the target process has a large number of queued messages:
- there is no a priori upper bound on the amount of memory being
allocated to hold that list, and
- the loop to retrieve the messages is uninterruptible, so the
Erlang scheduler where this executes blocks for the duration
We've seen process_info/1 bring down heavily loaded nodes on more
than one occasion. At least once it appeared to have blocked the
Erlang heart process from executing, causing the external heart to
kill the VM.
Consequently this removes 'messages' from the list of process_info
tags to retrieve for process_info/1. Note that process_info/1 still
retrieves 'message_queue_len', and process_info/2 can still retrieve
'messages' when asked to.
A few places in the OTP libraries need minor adjustments, since they
want 'message_queue_len' but compute it from the length of the list
of messages.
|
|
* maint:
dialyzer: Correct a parameterized opaque types bug
|
|
See also https://bugs.erlang.org/browse/ERL-565.
To avoid loops, erl_types:t_is_subtype checks for equality using
unopaqued types, but in (at least) one case something is lost:
This fix makes sure that when forwarding arguments in dataflow, types
with different parameters but equal when unopaqued are considered
different.
For example, dict:dict(0, {}) and dict:dict(0, []) are equal when
unopaqued (due to how dict(_, _) is declared in module dict), but
should be considered different when forwarding args.
|
|
|
|
* maint:
dialyzer: Fix a crash
|
|
|
|
* hasse/no_get_stacktrace/OTP-14861:
erts: Update abstract format doc with stacktrace variable
wx: Do not call erlang:get_stacktrace()
tools: Do not call erlang:get_stacktrace()
stdlib: Do not call erlang:get_stacktrace()
sasl: Do not call erlang:get_stacktrace()
runtime_tools: Do not call erlang:get_stacktrace()
reltool: Do not call erlang:get_stacktrace()
parsetools: Do not call erlang:get_stacktrace()
observer: Do not call erlang:get_stacktrace()
mnesia: Do not call erlang:get_stacktrace() (cont)
mnesia: Do not call erlang:get_stacktrace()
kernel: Do not call erlang:get_stacktrace()
inets: Do not call erlang:get_stacktrace()
eunit: Do not call erlang:get_stacktrace()
et: Do not call erlang:get_stacktrace()
dialyzer: Do not call erlang:get_stacktrace()
debugger: Do not call erlang:get_stacktrace()
debugger: Do not try to restore stacktrace
common_test: Do not call erlang:get_stacktrace()
|
|
|
|
|
|
* maint:
dialyzer: Fix bsl/2 bug
|
|
Also modified erl_bif_types:infinity_bsl() when called with zero as
first argument. As of writing this, erlang:'bsl'/2 is modified on the
master branch to never fail if called with a huge second argument.
|
|
* maint:
dialyzer: Add a test of erl_tar:table/1,2
Fix false Dialyzer warnings for erl_tar:table/1
|
|
|
|
* maint:
dialyzer: Correct handling of erlang:abs/1
|