Age | Commit message (Collapse) | Author |
|
|
|
The 's' operand overloads the tags for pids and ports to represent
X and Y registers, respectively. At load time, refuse to load the
module if the "literal" term is not a pid or port, as it would be
interpreted as a register.
This does not happen with normally compiled code, but it can happen
if the compiler (or beam_asm) is abused like in the following example:
make_bad() ->
Pid = self(),
Forms = [{attribute, 0, module, bad_s_operand},
{attribute, 0, export, [{test, 0}]},
{function, 0, test, 0,
[{clause, 0, [], [],
[{call,0,{atom,0,tuple_size},[{integer, 0, Pid}]}]}]}],
{ok, Module, Bin} = compile:forms(Forms, [no_copt,no_postopt,report_errors]),
code:load_binary(Module, "bad_s_operand.erl", Bin).
With this commit applied, the following message will be printed
when make_bad() is run:
=ERROR REPORT==== 10-Nov-2017::14:47:59 ===
Loading of bad_s_operand.erl failed: badfile
=ERROR REPORT==== 10-Nov-2017::14:47:59 ===
beam/beam_load.c(2396): Error loading function bad_s_operand:test/0: op bif1_body: bsd:
the term '<0.60.0>' would be confused with a register
|
|
Don't allow defining an specific operation more than once with
the exact same operands. Don't allow a specific operation to be
defined with different arities.
|
|
It can easily be implemented as $OPERAND_POSITION($Operand) == 0.
|
|
It is easy to to forget to use $REFRESH_GEN_DEST() in an instruction
that has a general destionation ('d'). Add a heuristic that should
catch most if not all such problems.
|
|
In beam_emu, use "erts_gc_" for any function that does garbage
collection, as preparation for adding more sanity checks.
|
|
Add an $IF() macro to conditionally expand macros. Use it like
this:
$IF(Expression, IfTrue, IfFalse)
Expression is a Perl expression that can be evaulated at macro
expansion time. If the expression evaluates to 0, the result will be
IfFalse, otherwise IfTrue.
|
|
Although the terminology "arguments" is used in the comments
for beam_makeops, the documentation in beam_makeops.md consistenly
use the term "operand". Since the name of the macro is user-facing,
it should be consistent with the documentation.
|
|
Make it easier to define new macros.
|
|
Any type that is a lower-case letter is allowed in a transformation,
even though some of them don't make sense, could cause compilation
errors when building the emulator, or crash at runtime. For example,
the type 'z' is emitted by the compiler, but eaten by the loader
before the transform engine can see it. Another example is the 'q'
type, which would crash the emulator if it was used on the right
side of a transformation rule.
In beam_makeops, define explicitly which types that are allowed in
patterns (on the left side) and in construction (on the right side).
Using that information, check the transformation rules thoroughly and
reject operands that don't make sense.
While we are it, also correct some misleading comments.
|
|
* lukas/erts/misc_fixes:
erts: Fix a bunch of compiler warnings
kernel: Fix gen_tcp_misc indentation
erts: Fail port_SUITE:huge_env if error code > 127
erts: Add lcnt prototype for dist locks update
|
|
|
|
* lukas/erts/fix_no_dot_makefile_dep/OTP-14439:
erts: missing makefile dependency
|
|
|
|
* lukas/erts/pgo/OTP-14604:
erts: Only do PGO if gcc supports -fprofile-correction
|
|
Correct erlang:is_builtin/3 for apply/2 and yield/0
|
|
|
|
* bjorn/compiler/eliminate-v3_life/OTP-14712:
Eliminate the v3_life pass
|
|
* maint:
erl_process_dump: Don't assume that literals can be found
Remove one superfluous closing parenthesis in oam_intro.xml
|
|
* bjorn/improve-crash-dumps/OTP-14685:
erl_process_dump: Don't assume that literals can be found
|
|
Native code does not register its literals in the code header for the
loaded code. Therefore, a literal created by native code can not be
found by mark_literal(). Ignore literals that can't be found instead
of crashing (the crasdump_viewer will report such literals as
incomplete heap data, but will not crash).
|
|
bitnitdit/bitnitdit/oam_intro-superfluous-closing-parenthesis
Remove one superfluous closing parenthesis in oam_intro.xml
|
|
|
|
* lukas/erts/gc-docs:
erts: Add Garbage Collection internal docs
|
|
|
|
|
|
* ingela/public_key-test:
public_key: Check that ec curve used for test is supported
|
|
erlang:is_builtin(erlang, M, F) returns false for apply/2 and
yield/0. The documentation for erlang:is_builtin/3 says that it
returns true for BIFs that are implemented in C. apply/2 and
yield/0 are implemented in C (as BEAM instructions), and
therefore the correct return value is true.
Also see a similar argument that was made for apply/3 in the past:
http://erlang.org/pipermail/erlang-bugs/2015-October/005101.html
https://bugs.erlang.org/browse/ERL-500
|
|
|
|
* ingela/inets/ERL-455/OTP-14716:
inets: Correct guard test
|
|
The v3_life pass does not do enough to be worth being its own
pass. Essentially it does two things:
* Calculates life-time information starting from the annotations
that v3_kernel provides. That part can be moved into v3_codegen.
* Rewrites the Kernel Erlang records to similar plain tuples
(for example, #k_cons{hd=Hd,tl=Tl} is rewritten to {cons,Hd,Tl}).
That rewriting is not needed and can be eliminated.
|
|
Guard test for error case was not updated to handle httpc stream concept
properly.
|
|
|
|
|
|
* ingela/inets/not-chunked-esi/OTP-14656:
inets: httpd - Fix broken handling of POST requests
|
|
* maint:
parsetools: Fix unused functions warnings in leexinc.hrl
|
|
maint
* hasse/parsetools/unused_funcs_leexinc/ERL-497/OTP-14697:
parsetools: Fix unused functions warnings in leexinc.hrl
|
|
|
|
* ingela/inets/http-sync-close/OTP-14696:
inets: Make sure httpd:stop_service is synchronous
|
|
New chunk mechanism of body data in POST requests added in
5d01c70ca399edf28e99dc760506329689fab6ba
broke handling of POST body data not using the new mechanism.
Added better regression test
|
|
|
|
* maint:
Updated OTP version
Update release notes
Update version numbers
erts: Fix so that bind correct schedulers
Update version
Fix error handling when decoding an AVP with an alternate dictionary
Remove unused function arguments
Fix faulty recursion
vsn -> 2.1.2
Update appup for ERIERL-14684
Fix speling error 'sndbuf' -> 'recbuf'
Add zlib:set_controlling_process/2
|
|
* maint-20:
Updated OTP version
Update release notes
Update version numbers
erts: Fix so that bind correct schedulers
Update version
Fix error handling when decoding an AVP with an alternate dictionary
Remove unused function arguments
Fix faulty recursion
vsn -> 2.1.2
Update appup for ERIERL-14684
Fix speling error 'sndbuf' -> 'recbuf'
Add zlib:set_controlling_process/2
|
|
|
|
|
|
|
|
into maint-20
* lukas/erts/fix-cpu-bind-w-modifies-scheduler-avail/OTP-14694:
erts: Fix so that bind correct schedulers
|
|
* anders/diameter/decode/OTP-14684:
vsn -> 2.1.2
Update appup for ERIERL-14684
|
|
* anders/diameter/decode/ERIERL-85:
Fix error handling when decoding an AVP with an alternate dictionary
Remove unused function arguments
Fix faulty recursion
|
|
* raimo/snmp/option-recbuf-broken-for-snmpm/OTP-13372:
Update version
Fix speling error 'sndbuf' -> 'recbuf'
|