Age | Commit message (Collapse) | Author |
|
When matched variable is used as a size field in multiple clauses,
as in:
foo(<<L:8,A:L>>) -> A;
foo(<<L:8,A:L,B:8>>) -> {A,B}.
the match tree would branch out before the segment that used the
matched-out variable (in this example, the tree would branch out before
the matching of A:L). That happens because the pattern matching
compilator did not take variable substitutions into account when
grouping clauses that match the same value.
That is, the generated code would work similarly to this code:
foo(<<L:8,T/binary>>) ->
case T of
<<A:L>> ->
A;
_ ->
case T of
<<A:L,B:8>> -> %% A matched out again!
{A,B}
end
end.
We would like the matching to work more like:
foo(<<L,A:L,T/binary>>) ->
case T of
<<>> -> A;
<<B:8>> -> {A,B}
end.
Fix the problem by taking the substitutions into account when grouping
clauses that match out the same value.
|
|
The bs_match_string instruction is used to speed up matching of
binary literals. For example, given this source code:
foo1(<<1,2,3>>) -> ok.
The matching part of the code will look like:
{test,bs_start_match2,{f,1},1,[{x,0},0],{x,0}}.
{test,bs_match_string,{f,3},[{x,0},24,{string,[1,2,3]}]}.
{test,bs_test_tail2,{f,3},[{x,0},0]}.
Nice. However, if we do a simple change to the source code:
foo2(<<1,2,3>>) -> ok;
foo2(<<>>) -> error.
the resulting matching code will look like (sligthly simplified):
{test,bs_start_match2,{f,4},1,[{x,0},0],{x,0}}.
{test,bs_get_integer2,{f,7},1,[{x,0},{integer,8},1,Flags],{x,1}}.
{test,is_eq_exact,{f,8},[{x,1},{integer,1}]}.
{test,bs_match_string,{f,6},[{x,0},16,{string,[2,3]}]}.
{test,bs_test_tail2,{f,6},[{x,0},0]}.
{move,{atom,ok},{x,0}}.
return.
{label,6}.
{bs_restore2,{x,0},{atom,start}}.
{label,7}.
{test,bs_test_tail2,{f,8},[{x,0},0]}.
That is, matching of the first byte is not combined into the
bs_match_string instruction that follows.
Fix this problem by allowing a bs_match_string instruction to be
used if all clauses will match either the same integer literal or
the empty binary.
|
|
In modules with huge functions with many bs_match_string
instructions, we can speed up the compilation by combining
adjacent bs_match_strings instruction in v3_codegen (as opposed
to in beam_block where we used to do it).
For instance, on my computer the v3_codegen became more than
twice as fast when compiling the re_testoutput1_split_test module
in the STDLIB test suites.
|
|
The optimizer of boolean expressions can often reject optimizations
that it does not recognize as safe. For instance, if a boolean
expression was preceded by 'move' instructions that saved x registers
into y registers, it would almost certainly reject the optimization
because it required the y register not be used in the code that
follows.
Fix this problem by allowing identical 'move' instructions that assing
to y registers at the beginning of the old and the optimized code.
While at it, correct the spelling of "preceding".
|
|
The usage calculation only looked at the allocation in GC BIFs, not
at the source and destination registers. Also, if there is a failure
label, make sure that we test whether the register can be used there.
|
|
The liveness at the failure label should be ignored, because if
there is an exception, all x registers will be killed.
|
|
The code generator uses conservative liveness information. Therefore
the number of live registers in allocation instructions (such as
test_heap/2) may be too high. Use the actual liveness information
to lower the number of live register if it's too high.
The main reason we want to do this is to enable more optimizations
that depend on liveness analysis, such as the beam_bool and beam_dead
passes.
|
|
Less conservative liveness analysis allows more optimizations
to be applied (such as the ones in beam_bool).
|
|
Add some comments to make the code generation for binary
construction somewhat clearer. Also get rid of the cg_bo_newregs/2
function that serves no useful purpose. (It was probably
intended to undo the effect of cg_live/2, but note that the
value passed to cg_bo_newregs/2 has not passed through cg_live/2.)
|
|
|
|
|
|
* sze/improve-interoperability-SSH-clients:
Improve interoperability with SSH clients
OTP-10475
|
|
* jn/ets-match-pattern-export-type:
Export ets:match_pattern/0 type
Conflicts:
lib/stdlib/src/ets.erl
OTP-10472
|
|
* hb/stdlib/opaque_warnings/OTP-10436:
Fix Dialyzer warnings
|
|
* sverk/code-load-refactor-later-op:
erts: Fix faulty lock check assert
erts: Refactor naming regarding code_write_permission
erts: Refactor tracing to use erts_schedule_thr_prgr_later_op
erts: Allow thr_prgr_later_op to reschedule
erts: Refactor code loading to use erts_schedule_thr_prgr_later_op
erts: Remove some compiler warnings
|
|
* ia/ssl/controlling-process-on-listen-socket/OTP-10447:
ssl: Improve #sslsocket{} API
ssl: It is now possible to call controlling_process on a listen socket, same as in gen_tcp.
|
|
This patch fixes a few problems of the SSH shell server that affect the
interoperability with SSH clients in widespread use.
First problem is that, whenever a channel_request message is
received with want_reply=true, the reply ends up being sent to the
servers channel id, not the clients channel id. This causes the client
to terminate the connection. The easiest solution to the problem appears
to be a new function in ssh_connection_manager.erl that translates the
servers channel id before sending the reply (in the same manner as
other functions do it).
Second problem is in ssh_cli.erl. When an SSH client sends a
window_change request between PTY allocation and starting the shell
(which appears to happen with some clients), ssh_cli.erl crashes
because #state.buf is yet 'undefined'. Allocating an empty buffer at PTY
allocation time solves the problem.
Affected SSH clients:
- all clients based on SSH-2.0-TrileadSSH2Java_213 (problem #1)
- SSH Term Pro (problem #2)
|
|
Scaling timetraps depending on cover, debug-compiled emulator and so
on is built-in to the test_server. Therefore, {multiply_timetraps,Scale}
should not be set (it would multiply the timeout value twice). Only
{scale_timetraps,true} needs to be set, and it must be set
unconditionally as the feature tests in
test_server:timetrap_scale_factor() may not return the correct
scale factor until the test_server node and test cases have been
started (for example, there is no cover server running).
|
|
Opaque types need to be exported.
|
|
* ia/ssh/sending-large-data-and-eof/OTP-10467:
ssh: Make test case platform independant
ssh: ssh_connection:channel_data() and send_eof() now return {error, closed} for closed or invalid channels.
ssh: Ensure that all data is sent before ssh:send returns.
ssh: add test suite for testing channel send/receive behavior.
|
|
* ia/ssl/sslv2-test:
ssl: Better test to determine if sslv2 is supported by openssl
|
|
The test case interrupted_send did not work on all platforms.
Also ct-ify the test suite
|
|
for closed or invalid channels.
ssh_connection:handle_msg(#ssh_msg_channel_close...) will now cause any send() that was in progress to immediately return {error,closed}.
|
|
|
|
|
|
* gp/make_erlang_mode_elpa_friendly:
Make erlang-mode more compatible with package.el
OTP-10465
|
|
|
|
* sa/dialyzer-fix-r15b02:
Fix a crash in race condition detection
Remove old untested experimental extension
Respect {plt_check,false} option when using dialyzer:run/1
Fix handling of tuple set remote types appearing in tuple sets
OTP-10464
|
|
* bjorn/test_server/fix-test-cases:
Provided better information when the test cases fail
Remove the useless test_server_line_SUITE test suite
test_server_SUITE: Remove the undefined_functions/1 test case
|
|
* egil/fix-doc-vxworks:
doc: Remove forgotten vxworks reference
|
|
* raimo/inets/https-proxy/OTP-10256:
inets httpc: Document that RFC 2817 is not supported
inets: Dialyzer fixes
inets httpc: TLS via proxy
inets: Remove obsolete testcases that are now in the proxy suite
inets: Add tests using external proxy running on localhost
|
|
|
|
|
|
Introduces new option htts_proxy so that it is possible
to have different proxies for http and https. The new option
defaults to the old proxy option.
Implements HTTP-1.1 extension method CONNECT to establish SSL/TLS tunnel
We choose not to implement "TLS upgrade" as defined by RFC 2817 as
this method of upgrade is vulnerable to man in the middle attacks,
can be easily broken by proxies and does not seem to be widely adopted.
|
|
|
|
|
|
|
|
|
|
A #sslsocket{} contains the fsm pid and value that was previously set to
old_ssl or new_ssl to make the transition period smoother. Now that old
ssl is not supported any more we use this field to store the inet socket
reference instead. This enables some API functions to return quicker
as they do not need to communicate with the fsm-process.
|
|
same as in gen_tcp.
Made error handling of listen sockets as arguments to funtions
expecting a connected socket more inet/gen_tcp like.
|
|
* dg/keyboard_interactive:
fix typo in keyboard-interactive string
OTP-10456
|
|
While at it, also make the path to the directory with the log files
a clickable link.
|
|
* siri/common_test/ct_snmp-tests:
[common_test] Added tests and corrected bugs in ct_snmp
OTP-10454
OTP-10434
|
|
* siri/os_mon/undefined-snmp-funcs/OTP-10448:
[os_mon] Remove call to deprecated/undefined functions in snmp
|
|
* vs/re_back_reference:
extend re back reference syntax with \g escape sequence
OTP-10455
|
|
* bjorn/erts/crash-dump-fix:
Fix missing information in crash dump for native-compiled modules
|
|
* bjorn/test_server/dialyzer-fixes:
test_server_ctrl: Don't use undocumented features of io:format()
Fix obsolete assumption for the return type of os:type/0
|
|
OTP-10454
OTP-10434
Function register_users/2, register_agents/2 and register_usm_users/2,
and the corresponding unregister_*/1 functions were not
executable. These are corrected/rewritten.
Function update_usm_users/2 is removed, and an unregister function is
added instead. Update can now be done with unregister_usm_users and
then register_usm_users.
Functions unregister_*/2 are added, so specific users/agents/usm users
can be unregistered.
Function unload_mibs/1 is added.
Overriding configuration files did not work, since the files were
written in priv_dir instead of in the configuration dir
(priv_dir/conf). This has been corrected.
Minor updates to documentation.
|
|
* hb/stdlib/opaque_warnings/OTP-10436:
Refine a few opaque types
Warn for underspecified opaque types
Warn for opaque types that are not exported
|
|
* hb/dialyzer/nowarn_unused_fun/OTP-10433:
dialyzer: Do not output warnings for unused funs
|