Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
This is analogous to the case of nil. Since #{} is a base-case of almost
all map types, contract and success typing sharing #{} does not mean
much, and is often sign of a violation.
|
|
mk_constraint_list/2 was simplifying (C OR TriviallyTrue) to (C), which
is obviously wrong.
|
|
The assumption that 'try' nodes were only used to wrap entire guards is
no longer true.
We're still swallowing warnings when the handler returns successfully.
Unfortunately, bind_guard/5 would need to be refactored to return a new
state in order to generate those warnings.
|
|
Dialyzer relies heavily on the assumption that the type of a literal
that is used as a pattern is the type of any value that can match that
pattern. For maps, that is not true, and it was causing bad analysis
results. A new help function dialyzer_utils:refold_pattern/1 identifies
maps in literal patterns, and unfolds and labels them, allowing them to
be properly analysed.
|
|
|
|
|
|
"DIscrepany" is replaced with "DIscrepancy" in every occurrence.
|
|
|
|
* maint:
dialyzer: Fix a bug concerning the option 'plt_remove'
|
|
[James Fish:]
Dialyzer always asserts that files and directories passed in its
options exist. Therefore it is not possible to remove a beam/module
from a PLT when the beam file no longer exists. Dialyzer should not to
check files exist on disk when removing from the PLT.
|
|
Conflicts:
lib/dialyzer/src/dialyzer_analysis_callgraph.erl
|
|
* Comment in dialyzer_analysis_callgraph what the call to
dialyzer_coordinator does;
* Delegate activation request to each dialyzer_worker;
* There is no reason for the dialyzer_coordinator to request
activation on behalf of the workers: let each worker request its
own activation as it leads to more consistent dialyzer_worker
module (activation is request as soon as status running is hit -
reguardless of mode) and it reduces lines of code.
* Clarify types in coordinator and worker e.g. make opaque and make
type more strict.
|
|
Also clarify in which modes the states `updating` and `waiting` can
happen in the loop.
|
|
|
|
Superfluous usage of insert_temp_exported_types had been in since
6452b57. (Change in commit 8a3ea1f module dialyzer_analysis_callgraph
is a correct simplification and is not relevant.)
|
|
... in order to reduce size of module dialyzer_callgraph, down from
~850 to ~750 lines.
|
|
|
|
|
|
|
|
|
|
If a behaviour module contains an non-exported function with the same name as
one of the behaviour's callbacks, the callback info was inadvertently deleted
from the PLT as the dialyzer_plt:delete_list/2 function was cleaning up the
callback table. This bug was reported by Brujo Benavides.
Fixes ERL-72 bug report.
|
|
|
|
Dialyzer used to report unknown behaviours in the same way as unknown
functions and types. This functionality has been removed in d101155, but
some code remained.
|
|
|
|
|
|
|
|
|
|
Record field types have been modified due to commit 8ce35b2:
"Take out automatic insertion of 'undefined' from typed record fields".
|
|
* sverk/hipe-fix-literal-crc:
erts,hipe,dialyzer: Fix hipe checkum of target runtime system
erts: Change THE_NON_VALUE to not be hard coded in hipe compiler
OTP-12962
OTP-12963
OTP-12964
|
|
Main problem:
A faulty HIPE_LITERAL_CRC was not detected by the loader.
Strangeness #1:
Dialyzer should ask the hipe compiler about the target checksum,
not an internal bif.
Strangeness #2:
The HIPE_SYSTEM_CRC checksum was based on the HIPE_LITERALS_CRC
checksum.
Solution:
New HIPE_ERTS_CHECKSUM which is an bxor of the two (now independent)
HIPE_LITERALS_CRC and HIPE_SYSTEM_CRC.
HIPE_LITERALS_CRC represents values that are assumed to stay constant
for different VM configurations of the same arch, and are therefor
hard coded into the hipe compiler.
HIPE_SYSTEM_CRC represents values that may differ between VM variants.
By default the hipe compiler asks the running VM for this checksum,
in order to create beam files for the same running VM.
The hipe compiler can be configured (with "make XCOMP=yes ...") to
create beam files for another VM variant, in which case HIPE_SYSTEM_CRC
is also hard coded.
ToDo:
Treat all erts properties the same. Either ask the running VM or hard
coded into hipe (if XCOMP=yes). This will simplify and reduce the risk
of dangerous mismatches. One concern might be the added overhead
from more frequent calls to hipe_bifs:get_rts_param.
|
|
|