Age | Commit message (Collapse) | Author |
|
Since commit 12b3790 Dialyzer has not reported unknown types.
|
|
|
|
* hasse/dialyzer/fix_warnings/OTP-14177:
dialyzer: Improve a warning
dialyzer: Fix a weird warning
dialyzer: Fix an opaque bug
dialyzer: Minor fix
|
|
Use init:get_argument(home) to find the location of the home
directory. That will work on all platforms (including Windows).
Note that the run-time system will fail to start if HOME
(or the equivalent on Windows) is not set. Therefore, it can
be assumed that init:get_argument(home) will not fail.
ERL-161
|
|
|
|
An opaque bug that would crash Dialyzer has been fixed.
The bug was reported by Nick Marino.
|
|
|
|
|
|
dialyzer_typesig:traverse_scc() now resets the context for each
element of the SCC. Since the results of traversing the elements are
saved in the 'cmap' table, there is no need to create an SCC
conjunction. For huge SCCs this saves quite some time: the
lift_lists() function added one element at a time, which made the
calculation of deps very slow.
|
|
Improve the evaluation of long lists of constraints.
|
|
File annotations {file, File} in Core Erlang code is replaced by
{file, FakeFile}, where FakeFile is "0", "1", ..., in order to save
memory. When a warning message is created, FakeFile is translated to
the original File (a bit awkward but easy to do).
The Core code stored in ETS tables needs less space, but more
important is that a less heap memory is used in the dataflow,
warnings, and typesig phases, allowing more parallelism.
|
|
The translation from forms to types is done in a separate process
in an attempt to reduce peak memory usage.
Expect further optimizations as it is probably not feasible
in the long run to keep all type information on the heap.
|
|
|
|
|
|
|
|
|
|
Some SCC info is no longer cached. It reduces the peak memory
consumption of workers during the typesig phase, and seems to cost
very little time.
|
|
The cache used for speeding up the translation from forms to types is
no longer global, but reset per module. The peak memory consumption
is reduced, and the added time seems to be small.
|
|
Using erlang:system_info(schedulers_online) for determining
parallelism is recommended by OTP experts. It takes care of "+S 4:1"
and simultaneous loading of HiPE code.
|
|
The condensed graph of SCCs occupies less ETS memory. A table
translating to and from SCC to a unique integer is introduced.
|
|
By not using ETS when calculating the condensation of graphs, peak
heap memory consumption is reduced.
|
|
The mini PLT is extended to hold all data of the full PLT, and the
full PLT is restored when needed (for storing the PLT on file).
|
|
|
|
Suggested by Kostis.
|
|
Messages regarding guards with orelse/andalso could look
like "Clause guard cannot succeed. The variable A was matched
against the type any()". Now they look like as if or/and is
used: "Guard test is_integer(A::atom()) can never succeed".
|
|
Messages like "Invalid type specification for function
para3:exp_adt/0. The success typing is () -> 3" now look like
"The specification for para3:exp_adt/0 has an opaque subtype
para3_adt:exp1(para3_adt:exp2()) which is violated by the success
typing () -> 3".
The old message did not give any clue as to what invalidated the
contract, namely the opaque subtype.
|
|
Messages like "The attempt to match a term of type rec_api:f()
against the variable _ breaks the opaqueness of rec_adt:f()" now
look like "The attempt to match a term of type rec_adt:f()
against the record field 'f' with type rec_api:f() breaks the
opaqueness of the term".
|
|
If a dialyzer module attribute references an undefined (local)
function an error tuple is thrown but no caught. This leads to a
'nocatch' error and not the intended "clean" error.
|
|
|
|
Let it handle `dial_warning()` input as well, to match what `format_warning/2` expects.
|
|
Warnings about clauses that cannot match and are also compiler generated
are suppressed unless none of the clauses return.
This feature is useful for non-Erlang BEAM languages (such as Elixir)
that compile to Erlang and expand certain language constructs into case
statements. In that case, as long as the language construct can succeed,
these warnings are undesired and appear spurious to users that do not
check the Erlang code that their program expands into.
Thanks to José Valim for the test (slightly modified).
|
|
|
|
|
|
|
|
|
|
* stavros/dialyzer/fix_call_site_analysis/OTP-13655/PR-1092:
Fix a bug in Dialyzer related to call-site analysis
|
|
Dialyzer's "dataflow" module is using information from the callgraph to
determine which functions may be called at a particular call-site. Unfortunately
this information can include functions that are certainly not among the possible
choices. We don't want to emit warnings in such cases, so a "reasonable"
compromise is to stay silent if there are many possible funs and at least one of
them can succeed.
Bug reported by Dan Gudmundsson, test shrunk down by Magnus Lång.
|
|
Dialyzer failed to remove all loops among constraints.
|
|
* kostis/dialyzer/opaque_type/OTP-13586/PR-1047:
Declare the erl_types:var_table() type as opaque
|
|
|
|
|
|
Dialyzer's dependency calculation was throwing an error when
encountering an 'apply' node with something that was not a variable
(e.g., a literal). The rest of the code did not know what to do with
this error, which resulted in dialyzer crashing. Fix this by ingoring
the detected error in the dependency calculation phase; later dialyzer
passes know how to properly handle and report this kind of errors
anyway.
This fixes [Erlang-JIRA] (ERL-138).
|
|
and do the following changes:
in erl_types: export the type and an appropriate constructor for it
in dialyzer_contracts: perform all necessary code modifications to
fix all dialyzer warnings
Although no warnings are reported by dialyzer, it's quite possible that
these are not the only places where the opacity of the var_table() data
structure is violated. But I decided to leave these places for a better
version of dialyzer to discover...
|
|
|
|
Optimization: A few dictionaries are maps instead of dicts.
|
|
The evaluation of a single SCC has been optimized.
The parallelism when evaluating a single SCC has been removed.
|
|
* experimental/correct_dialyzer_spelling/PR-1007/OTP-13544:
Correct mispelling in Dialyzer's acronym definition
|
|
28a4a5057ab9 mistakenly used the non-existing type cerl:tree() instead
of cerl:cerl().
|
|
dialyzer_typesig:traverse/3 would perform an unsafe optimisation when
given a cons pattern that contained a map and could be folded into a
literal with cerl:fold_literal/1. In this case, when traversing the map
a type variable would be generated, but this variable would be dropped
by the erl_types:t_cons/2 constructor by in turn calling t_sup(),
producing the overapproximation any(). However, in this particular case,
dialyzer_typesig:traverse/3 is not allowed to overapproximate, since its
result is used in an EQ-constraint.
Although erl_types:t_tuple/1 does not overapproximate like t_cons/2,
which makes the bug unlikely to affect tuples too, the fix was
nevertheless applied defensively to the case of tuples as well.
Also, fix a bug where dialyzer_utils:refold_pattern/1 would generate
syntax nodes with two {label, _} attributes.
|
|
|