Age | Commit message (Collapse) | Author |
|
The following code causes a compiler failure:
first_after(Data, Offset) ->
case byte_size(Data) > Offset of
false ->
{First, Rest} = {ok, ok},
ok;
true ->
<<_:Offset/binary, Rest/binary>> = Data,
%% 'Rest' saved in y(0) before the call.
{First, _} = match_first(Data, Rest),
%% When beam_bsm sees the code, the following line
%% which uses y(0) has been optimized away.
{First, Rest} = {First, Rest},
First
end.
match_first(_, <<First:1/binary, Rest/binary>>) ->
{First, Rest}.
Here is the error message from beam_validator:
t: function first_after/2+15:
Internal consistency check failed - please report this bug.
Instruction: {call,2,{f,7}}
Error: {multiple_match_contexts,[{x,1},0]}:
Basically, what happens is that at time of code generation,
the variable 'Rest' is needed after the call to match_first/2
and is therefore saved in y(0). When beam_bsm (a late optimization
pass) sees the code, the use of y(0) following the call
to match_first/2 has been optimized away. beam_bsm therefore
assumes that the delayed sub-binary creation is safe. (Actually,
it is safe, but beam_validator does not realize it.)
The bug was caused by two separate commits:
e199e2471a reduced the number of special cases to handle in BEAM
optimization passed by breaking apart the tail-recursive call
instructions (call_only and call_last) into separate instructions.
Unfortunately, the special handling for tail calls was lost, which
resulted in worse code (i.e. the delayed sub-binary creation
optimization could not be applied).
e1aa422290 tried to compensate, but did so in a way that was not
always safe.
Teaching beam_validator that this kind of code is safe would be
expensive.
Instead, we will undo the damage caused by the two
commits. Re-introduce the special handling of tail-recursive calls in
beam_bsm that was lost in the first commit. (Effectively) revert the
change in the second commit.
ERL-268
|
|
* hasse/parsetools/fix_leex_counting/ERL-263/OTP-13916:
parsetools: Correct counting of newlines
|
|
* dgud/wx/drop-files/OTP-13933:
wx: add wxWindowDragAcceptFiles
wx: Add simple dropfiles support
|
|
|
|
* bjorn/compiler/beam_block/ERL-266/OTP-13931:
beam_block: Avoid unsafe inclusion of get_map_elements in blocks
|
|
c2035ebb8b restricted the get_map_elements instruction so that it
could only occur at the beginning of a block. It turns out that
including it anywhere in a block is unsafe.
Therefore, never put get_map_elements instruction in blocks.
(Also remove the beam_utils:join_even/2 function since it is no
longer used.)
ERL-266
|
|
* dgud/emacs/do-not-require-final-newline/PR-1130:
erlang-mode: do not configure require-final-newline
|
|
* cypherfox/edoc/add_doc/PR-1175:
add info for param and returns tags
|
|
* hizel/howto/win32-include-path-fix/PR-1187:
Fix build environment script in HOWTO INSTALL-WIN32
|
|
* RoadRunnr/crypto/no-rc4/PR-1169/OTP-13896:
disable RC4 in SSL when crypto doesn't support it
Fix compilation when OpenSSL doesn't support RC4
Conflicts:
lib/crypto/c_src/crypto.c
|
|
* legoscia/crypto/no-rc2/PR-1163/OTP-13895:
Fix compilation when OpenSSL doesn't support RC2
|
|
* ingela/ssl/tests/ssl_packet_0_or_raw:
ssl: Correct tests tcp stream handling
|
|
Data collection function active_once_raw/4 did not handle streamed
data correctly (it assumed the stream was "packet oriented"),
which could result in that the test case perceived that
it did not receive all data even though it did.
|
|
|
|
|
|
* lukas/erts/bin_to_term_doc_example/PR-1181:
erts: Add examples to binary_to_term and term_to_binary
|
|
* ingela/ssl/anonymous/OTP-13926:
ssl: Correct anonymous suite handling
|
|
* lukas/erts/fix_errno_name/OTP-13927:
erts: Rename __errno in order to avoid conflict on openbsd
|
|
Test suite did not take TLS-version in to account. Also
some anonymous suites where included incorrectly in some TLS versions.
|
|
* rickard/macosx-config-mess/OTP-13904:
Try to handle not yet available functionality in MacOSX SDK
Check deployment target in configure on MacOSX
Fix posix_memalign configure test
|
|
|
|
* siri/doc-add_pathsa-order/ERL-267/OTP-13920:
Document the order of directories added with code:add_pathsa/1
|
|
Enable window to handle drop file events.
|
|
See https://bugs.erlang.org/browse/ERL-263
The fix in commit c9bc5c94 of PR-431
(https://github.com/erlang/otp/pull/431) introduced new problems.
|
|
* hasse/parsetools/fix_leex_unicode/OTP-13919:
parsetools: Correct handling of Unicode in Leex
|
|
code:add_pathsa/1 reverts the list of directories when adding it at
the beginning of the code path. The command line option '-pa' behaves
in the same way. This is now documented.
|
|
|
|
'legoscia/dynamic-child-shutdown-tuple/ERL-163/PR-1158/OTP-13907' into maint
* legoscia/dynamic-child-shutdown-tuple/ERL-163/PR-1158/OTP-13907:
Don't report error for shutdown exit tuple
|
|
Added wxDropFiles event
|
|
|
|
|
|
|
|
* lucafavatella/erts/fix-typo-fp/PR-1177:
Fix typo in configuration description
|
|
* github/pr/1183:
Fix typos in public_key_app.xml
|
|
* ahmedshafeeq/inets-httpc-RFC-7231/PR-1172/OTP-13902:
Update test case docs with RFC-7231
Update behavior of httpc:request to match RFC-7231
|
|
|
|
|
|
* ingela/ssl/prepare-patch:
ssl: Prepare for release
|
|
* ingela/ssl/ECC-selection-fix/OTP-13918:
ssl: Correct ECC curve selection, the error could cause default to always be selected.
|
|
* ingela/ssl/handshake-event-queue/OTP-13917:
ssl: Avoid event reordering
|
|
The 'dfa_graph' option did not work with Unicode.
The testcase 'unicode' was not correct.
|
|
selected.
|
|
|
|
|
|
|
|
|
|
Several handshake events may be received in the same TLS packet. Then there
will be several events pushed to the gen_statems internal queue.
New events already in the socket-buffer should not be processed
if there are more unprocessed handshake events in next_event queue.
We need to handle this in the next_record/1 function.
|
|
* andrey/stdlib/fix_edlin_expand/ERL-1152:
stdlib: Add a testcase for Unicode expander
Support for unicode expander
|
|
|
|
|