aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-11-13Refuse to load "literals" that can be confused with registersBjörn Gustavsson
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
2017-11-07Strengthen tests of definition of specific instructionsBjörn Gustavsson
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.
2017-11-06Remove redundant built-in macro $IS_PACKED()Björn Gustavsson
It can easily be implemented as $OPERAND_POSITION($Operand) == 0.
2017-11-06Warn when $REFRESH_GEN_DEST() is not used after a GCBjörn Gustavsson
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.
2017-11-06Consistently use the "erts_gc_" prefix for functions that do GCBjörn Gustavsson
In beam_emu, use "erts_gc_" for any function that does garbage collection, as preparation for adding more sanity checks.
2017-11-06Add the built-in macro $IF() to handle conditionalsBjörn Gustavsson
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.
2017-11-06Rename the built-in macro ARG_SIZE() to OPERAND_SIZE()Björn Gustavsson
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.
2017-11-06Clean up definition of built-in macrosBjörn Gustavsson
Make it easier to define new macros.
2017-11-01beam_makeops: Strengthen the checking of transformationsBjörn Gustavsson
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.
2017-10-30Merge branch 'lukas/erts/misc_fixes'Lukas Larsson
* 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
2017-10-30erts: Fix a bunch of compiler warningsLukas Larsson
2017-10-30Merge branch 'lukas/erts/fix_no_dot_makefile_dep/OTP-14439'Lukas Larsson
* lukas/erts/fix_no_dot_makefile_dep/OTP-14439: erts: missing makefile dependency
2017-10-30erts: missing makefile dependencyJohn Högberg
2017-10-30Merge branch 'lukas/erts/pgo/OTP-14604'Lukas Larsson
* lukas/erts/pgo/OTP-14604: erts: Only do PGO if gcc supports -fprofile-correction
2017-10-30Merge pull request #1610 from bjorng/bjorn/erts/is_builtin/ERL-500/OTP-14713Björn Gustavsson
Correct erlang:is_builtin/3 for apply/2 and yield/0
2017-10-30Update primary bootstrapBjörn Gustavsson
2017-10-30Merge branch 'bjorn/compiler/eliminate-v3_life/OTP-14712'Björn Gustavsson
* bjorn/compiler/eliminate-v3_life/OTP-14712: Eliminate the v3_life pass
2017-10-30Merge branch 'maint'Björn Gustavsson
* maint: erl_process_dump: Don't assume that literals can be found Remove one superfluous closing parenthesis in oam_intro.xml
2017-10-30Merge branch 'bjorn/improve-crash-dumps/OTP-14685' into maintBjörn Gustavsson
* bjorn/improve-crash-dumps/OTP-14685: erl_process_dump: Don't assume that literals can be found
2017-10-30erl_process_dump: Don't assume that literals can be foundBjörn Gustavsson
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).
2017-10-30Merge pull request #1612 from ↵Rickard Green
bitnitdit/bitnitdit/oam_intro-superfluous-closing-parenthesis Remove one superfluous closing parenthesis in oam_intro.xml
2017-10-29Remove one superfluous closing parenthesis in oam_intro.xmlbitnitdit
2017-10-27Merge branch 'lukas/erts/gc-docs'Lukas Larsson
* lukas/erts/gc-docs: erts: Add Garbage Collection internal docs
2017-10-27erts: Add Garbage Collection internal docsLukas Larsson
2017-10-27Merge branch 'maint'Ingela Anderton Andin
2017-10-27Merge branch 'ingela/public_key-test' into maintIngela Anderton Andin
* ingela/public_key-test: public_key: Check that ec curve used for test is supported
2017-10-27Correct erlang:is_builtin/3 for apply/2 and yield/0Björn Gustavsson
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
2017-10-27Merge branch 'maint'Ingela Anderton Andin
2017-10-27Merge branch 'ingela/inets/ERL-455/OTP-14716' into maintIngela Anderton Andin
* ingela/inets/ERL-455/OTP-14716: inets: Correct guard test
2017-10-27Eliminate the v3_life passBjörn Gustavsson
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.
2017-10-26inets: Correct guard testIngela Anderton Andin
Guard test for error case was not updated to handle httpc stream concept properly.
2017-10-26public_key: Check that ec curve used for test is supportedIngela Anderton Andin
2017-10-26Merge branch 'maint'Ingela Anderton Andin
2017-10-26Merge branch 'ingela/inets/not-chunked-esi/OTP-14656' into maintIngela Anderton Andin
* ingela/inets/not-chunked-esi/OTP-14656: inets: httpd - Fix broken handling of POST requests
2017-10-25Merge branch 'maint'Hans Bolinder
* maint: parsetools: Fix unused functions warnings in leexinc.hrl
2017-10-25Merge branch 'hasse/parsetools/unused_funcs_leexinc/ERL-497/OTP-14697' into ↵Hans Bolinder
maint * hasse/parsetools/unused_funcs_leexinc/ERL-497/OTP-14697: parsetools: Fix unused functions warnings in leexinc.hrl
2017-10-25Merge branch 'maint'Ingela Anderton Andin
2017-10-25Merge branch 'ingela/inets/http-sync-close/OTP-14696' into maintIngela Anderton Andin
* ingela/inets/http-sync-close/OTP-14696: inets: Make sure httpd:stop_service is synchronous
2017-10-25inets: httpd - Fix broken handling of POST requestsIngela Anderton Andin
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
2017-10-25erts: Only do PGO if gcc supports -fprofile-correctionLukas Larsson
2017-10-25Merge branch 'maint'John Högberg
* 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
2017-10-25Merge branch 'maint-20' into maintJohn Högberg
* 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
2017-10-25Updated OTP versionOTP-20.1.3Erlang/OTP
2017-10-25Update release notesErlang/OTP
2017-10-25Update version numbersErlang/OTP
2017-10-25Merge branch 'lukas/erts/fix-cpu-bind-w-modifies-scheduler-avail/OTP-14694' ↵Erlang/OTP
into maint-20 * lukas/erts/fix-cpu-bind-w-modifies-scheduler-avail/OTP-14694: erts: Fix so that bind correct schedulers
2017-10-25Merge branch 'anders/diameter/decode/OTP-14684' into maint-20Erlang/OTP
* anders/diameter/decode/OTP-14684: vsn -> 2.1.2 Update appup for ERIERL-14684
2017-10-25Merge branch 'anders/diameter/decode/ERIERL-85' into maint-20Erlang/OTP
* anders/diameter/decode/ERIERL-85: Fix error handling when decoding an AVP with an alternate dictionary Remove unused function arguments Fix faulty recursion
2017-10-25Merge branch 'raimo/snmp/option-recbuf-broken-for-snmpm/OTP-13372' into maint-20Erlang/OTP
* raimo/snmp/option-recbuf-broken-for-snmpm/OTP-13372: Update version Fix speling error 'sndbuf' -> 'recbuf'
2017-10-25Merge branch 'john/erts/zlib-ctrl-proc/OTP-14672/ERL-494' into maint-20Erlang/OTP
* john/erts/zlib-ctrl-proc/OTP-14672/ERL-494: Add zlib:set_controlling_process/2