Age | Commit message (Collapse) | Author |
|
Consider the following functions:
foo() -> bar(not_a_map).
bar(M) when not is_map_key(a, M) -> ok;
bar(_) -> error.
What will `foo/0` return? It depends. If the module is compiled
with the default compiler options, the return value will be
`ok`. If the module is compiled with the `inline` option,
the return value will be `error`.
The correct value is `error`, because the call to `is_map_key/2`
when the second argument is not a map should fail the entire
guard. That is the way other failing guards BIFs are handled.
For example:
foo() -> bar(not_a_tuple).
bar(T) when not element(1, T) -> ok;
bar(_) -> error.
`foo/0` always returns `error` (whether the code is inlined
or not).
This bug can be fixed by changing the classification of `is_map_key/2`
in the `erl_internal` module. It is now classified as a type test,
which is incorrect because type tests should not fail. Reclassifying
it as a plain guard BIF corrects the bug.
This correction also fixes the internal consistency check
failure which was reported in:
https://bugs.erlang.org/browse/ERL-699
|
|
bjorng/bjorn/compiler/binary-syntax/ERL-689/OTP-15219
Fix bug in binary matching
|
|
|
|
* rickard/full-cache-nif-env/OTP-15223/ERL-695:
Fix caching of NIF environment when executing dirty
|
|
'john/compiler/fix-deterministic-include-paths/OTP-15204/ERL-679' into maint
* john/compiler/fix-deterministic-include-paths/OTP-15204/ERL-679:
Omit include path debug info for +deterministic builds
|
|
* ingela/maint/ssl/ECC/ERIERL-210/OTP-15203:
ssl: Make sure that a correct cipher suite is selected
|
|
The keyexchange ECDHE-RSA requires an RSA-keyed server cert
(corresponding for ECDHE-ECDSA), the code did not assert this
resulting in that a incorrect cipher suite could be selected.
Alas test code was also wrong hiding the error.
|
|
Compiling the same file with different include paths resulted in
different files with the `+deterministic` flag even if everything
but the paths were identical. This was caused by the absolute path
of each include directory being unconditionally included in a
debug information chunk.
This commit fixes this by only including this information in
non-deterministic builds.
|
|
|
|
In the documentation, we don't use contractations such as
"don't" or "that's". We also avoid abbreviations. "i.e."
should be written out as "that is". In this case it is
better to omit it altogether.
629ad2e0971ef introduced the violation.
|
|
Ref ordering fix (ERL-690)
OTP-15225
|
|
bjorng/bjorn/compiler/letrec-side-effect-fix/ERL-658/OTP-15188
Fix side-effect optimization when compiling from Core Erlang
|
|
* ingela/ssl/error-state/ERL-685/OTP-15216:
ssl: Correct close handling
|
|
Add clarification on nil type
OTP-15222
|
|
As explained by @psyeugenic on Slack:
> empty list `[]` is regarded as a separate type from `list()`, `[]` < `list()`
> i.e. nil is `[]`
|
|
The compiler generates incorrect code for the following example:
decode_binary(_, <<Length, Data/binary>>) ->
case {Length, Data} of
{0, _} ->
%% When converting the match context back to a binary,
%% Data will be set to the entire original binary,
%% that is, to <<0>> instead of <<>>.
{{0, 0, 0}, Data};
{4, <<Y:16/little, M, D, Rest/binary>>} ->
{{Y, M, D}, Rest}
end.
The problem is the delayed sub binary creation optimization, which
is not safe to do in this case.
This commit introduces a heuristic that will disable the delayed
sub binary creation optimization for this example. Unfortunately, the
heuristic may turn off the optimization when it would actually be
safe. In the OTP codebase, the optimization is turned off in two
instances, once in string.erl and once in dets_v9.erl.
https://bugs.erlang.org/browse/ERL-689
|
|
Eliminate double computation of next var
|
|
beam_validator: Fix false diagnostic for a receive nested in a try
OTP-15218
|
|
When an expression is only used for its side effects, we try to
remove everything that doesn't tie into a side-effect, but we
went a bit too far when we applied the optimization to funs
defined in such a context. Consider the following:
do letrec 'f'/0 = fun () -> ... whatever ...
in call 'side':'effect'(apply 'f'/0())
'ok'
When f/0 is optimized under the assumption that its return value
is unused, side:effect/1 will be fed the result of the last
side-effecting expression in f/0 instead of its actual result.
https://bugs.erlang.org/browse/ERL-658
Co-authored-by: Björn Gustavsson <[email protected]>
|
|
|
|
|
|
The keyexchange ECDHE-RSA requires an RSA-keyed server cert
(corresponding for ECDHE-ECDSA), the code did not assert this
resulting in that a incorrect cipher suite could be selected.
Alas test code was also wrong hiding the error.
|
|
Transport accepted sockets that are in the error state, was not closed
properly.
|
|
My compiler benchmarks on modules with huge functions, show the
next_free_variable_name call to be expensive. It turns out one
of the 3 calls to the function was completely ignored.
|
|
* ingela/ssl/typos:
ssl: Fix typos
|
|
Update documentation for ct:timetrap/1
|
|
Fix kernel_app doc logger_level defaults
|
|
|
|
When nesting a receive in a try/catch, there could be a false
diagnostic that a fragile term is used.
https://bugs.erlang.org/browse/ERL-684
|
|
Even when `ct:sleep/1` accepts `Millisecs` as floats, `ct:timetrap/1` does not.
If you try to use it in a test, you get the following error:
```erlang
{invalid_time_format,0.1}
```
|
|
Improve Cover HTML page
OTP-15213
|
|
* maint-20:
Updated OTP version
Prepare release
Fix NIF stack recursion bug and enforce a limit
Conflicts:
OTP_VERSION
lib/asn1/doc/src/notes.xml
lib/asn1/vsn.mk
otp_versions.table
|
|
* lukas/erts/seq_trace_fix_token_clear/ERL-602/OTP-15038:
erts: Fix seq_trace to not clear token for system messages
|
|
A lot of erts internal messages used behind APIs to create
non-blocking calls, e.g. port_command, would cause the seq_trace
token to be cleared from the caller when it should not.
This commit fixes that and adds asserts that makes sure
that all messages sent have to correct token set.
Fixes: ERL-602
|
|
* lukas/erts/fix_udp_realloc_bug:
erts: Limit the automatic max buffer for UDP to 2^16
erts: Free udp buffer when getting EAGAIN
|
|
* lukas/erts/etoomanyrefs_forker/OTP-15210:
erts: Handle EMFILE errors in forker_driver for write
|
|
|
|
|
|
maint-20
* raimo/asn1/fix-ber-decode-recursion/ERIERL-220/OTP-14440:
Fix NIF stack recursion bug and enforce a limit
|
|
Fix recursion bug when decoding Constructed value within another
value - here the allowed buffer for the recursed decode shall
only be the size of the enclosing value, not the whole buffer.
Return ASN1_ERROR if BER decode recurses more than about 8 kWords.
|
|
erl_alloc: align ErtsAllocatorState_t
|
|
Fix spec for erl_syntax_lib:analyze_type_application/1
|
|
There is no reason to have a larger buffer than this as
the recvmsg call will never return more data.
OTP-15206
|
|
Before this change, if a write to the uds failed due to
EMFILE to ETOOMANYREFS the entire vm would crash. This
change makes it so that an SIGCHLD is simulated to that
the error is propagated to the user instead of terminating
the VM.
|
|
* lukas/erts/win_break_poll_thread_fix/OTP-15205:
erts: Fix bug where break would not trigger on windows
|
|
|
|
|
|
|
|
* maint-20:
Updated OTP version
Prepare release
ssl: Engine key trumps certfile option
inets: Prepare for release
inets: Improve error handling
|
|
Fix typo in xmerl_scan:string/1
|