aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
AgeCommit message (Collapse)Author
2014-11-17Merge branch 'maint'Björn Gustavsson
* maint: Fix miscompilation when module contains multiple named funs Fix locations of shadowing warnings in ms_transform
2014-10-27Fix miscompilation when module contains multiple named funsAnthony Ramine
A module containing two named funs bearing the same name and arity could be miscompiled. Reported-by: Sam Chapin
2014-10-20Merge branch 'tuncer/compiler/finalize-asm-deprecation/OTP-12100'Björn Gustavsson
* tuncer/compiler/finalize-asm-deprecation/OTP-12100: compiler: finalize 18.x 'asm' deprecation
2014-10-03Merge branch 'egil/maps/variable-keys/OTP-12218'Björn-Egil Dahlberg
* egil/maps/variable-keys/OTP-12218: (22 commits) compiler: Update test for Maps aliasing compiler: Properly support Map aliasing compiler: Refactor Map pairs aliasing compiler: Fix harmless need_heap error for Maps stdlib: Update Map tests stdlib: Use environment bindings for Maps keys in erl_eval matching debugger: Update Map tests compiler: Update Map tests compiler: Fix v3_core Maps pair chains compiler: Use expressions in core patterns compiler: Use variables in Map cerl inliner compiler: Reintroduce binary limit for Map keys compiler: Shameless v3_core hack for variables compiler: Use variables in Map beam assmebler compiler: Use variables in Map kernel pass compiler: Use variables in Map core pass compiler: Normalize unary ops on Maps key literals stdlib: Update Map tests stdlib: erl_lint Map key variables compiler: Maps are always patterns never values in matching ...
2014-10-02compiler: Update test for Maps aliasingBjörn-Egil Dahlberg
2014-08-26compiler: Update Map testsBjörn-Egil Dahlberg
2014-08-14compiler: finalize 18.x 'asm' deprecationTuncer Ayaz
'asm' was deprecated in 18315c16, to be removed in 18.x.
2014-08-14Merge branch 'nox/compiler/improve-core-lint'Björn Gustavsson
* nox/compiler/improve-core-lint: Remove obsolete comment in core_lint Handle return mismatches for calls and primops Check for more return mismatches Use +clint0 in compiler's test suites
2014-08-07Use +clint0 in compiler's test suitesAnthony Ramine
2014-06-16Fix handling of latin1 characters in false ifdef branchesBjörn Gustavsson
The fallback to latin-1 encoding would not work if the invalid UTF-8 characters occurred in a skipped branch in an -ifdef/-ifndef.
2014-04-03compiler,stdlib: Fix Map literals as keys for Maps in patternsBjörn-Egil Dahlberg
2014-03-26Merge branch 'egil/maps-compiler-coverage'Björn-Egil Dahlberg
* egil/maps-compiler-coverage: compiler: Do not evaluate map expressions with bad keys compiler: Throw 'nomatch' on matching with bad binary keys compiler: Variable keys are not allowed in Maps compiler: Strengthen Maps warnings tests compiler: map_pair cannot be a type clause in v3_life compiler: Remove redudant code in v3_codegen compiler: Test deep map structure compiler: Remove redundant clause in v3_codegen compiler: Cover #{ [] => Var } in testcase
2014-03-25compiler: Do not evaluate map expressions with bad keysBjörn-Egil Dahlberg
Map keys with large (non literal) binary keys must fail.
2014-03-25compiler: Throw 'nomatch' on matching with bad binary keysBjörn-Egil Dahlberg
Even if a binary key is written as a literal the compiler may choose to make an expression. Emit a warning in those cases and saying the case will not match. This is a limitation in current implementation.
2014-03-25compiler: Strengthen Maps warnings testsBjörn-Egil Dahlberg
Increases coverage.
2014-03-25Correctly handle non-matching patterns against literal valuesAnthony Ramine
The pass sys_core_fold did not correctly handle non-matching patterns in code such as: 0 = case <<>> of <<>> -> 0; a -> 1 end. Function case_opt_lit/3 is rewritten in two passes to first remove any non-matching clause and only then potentially remove the related patterns in each clause. Reported-by: Ulf Norell
2014-03-24compiler: Test deep map structureBjörn-Egil Dahlberg
2014-03-24compiler: Cover #{ [] => Var } in testcaseBjörn-Egil Dahlberg
Coverage removed by literals.
2014-03-19Merge branch 'nox/maps-v3_core-lit_vars'Björn-Egil Dahlberg
* nox/maps-v3_core-lit_vars: Properly collect variables in map expressions in v3_core
2014-03-19Merge branch 'bjorn/compiler/utf8-warning/OTP-11791'Björn Gustavsson
* bjorn/compiler/utf8-warning/OTP-11791: Don't fail compilation for modules that contain invalid UTF-8 epp: Make it possible to specify a default encoding
2014-03-18Don't fail compilation for modules that contain invalid UTF-8Björn Gustavsson
The default encoding for Erlang modules is now UTF-8, and the compilation would fail if a module contained byte sequences that are not valid UTF-8 sequences. In a large project with say many hundreds of Erlang modules with names of developers such as "Björn" or "Håkan" encoded in latin-1, that could mean that many hundreds of files would need to be modified just to get started testing OTP 17. As a temporary measure to ease the transition, automatically fall back to the latin-1 encoding with a warning for any module that contains invalid byte sequences and for which no encoding has been specified. The intention is to remove this workaround in OTP 18 or 19.
2014-03-18Properly collect variables in map expressions in v3_coreAnthony Ramine
Reported-by: José Valim
2014-03-17compiler: Change Maps Core FormatBjörn-Egil Dahlberg
Ex. Instead of: M~{~<K,V>}~ The format is now: ~{~<K,V>|M}~ This also removes a shift/reduce warning. The changes in core_pp now requires compiler-5.0 to compile because of is_map/1 guard, i.e. a need for a compiler with Maps know-how.
2014-03-14Merge branch 'nox/compiler/beam_bool-mixed-boolean'Björn Gustavsson
* nox/compiler/beam_bool-mixed-boolean: Properly detect reused boolean values in beam_bool
2014-03-10Properly handle redundant boolean clauses in sys_core_foldAnthony Ramine
Boolean case expressions with redundant clauses could make the compiler crash: case X == 0 of false -> no; false -> no; true -> yes end. Reported-by: Ulf Norell
2014-03-08Properly detect reused boolean values in beam_boolAnthony Ramine
The following code could crash the compiler: f(X = true) when X or true or X -> ok. Reported-by: Ulf Norell
2014-03-07Merge branch 'nox/maps-beam_jump-put_map'Björn-Egil Dahlberg
* nox/maps-beam_jump-put_map: Properly collect labels in put_map instructions in beam_jump
2014-03-06Merge branch 'nox/maps-cerl_clauses'Björn-Egil Dahlberg
* nox/maps-cerl_clauses: Support maps in cerl_clauses:match/2
2014-03-06Merge branch 'nox/maps-beam_jump'Björn-Egil Dahlberg
* nox/maps-beam_jump: Properly check label use in get_map_elements in beam_jump
2014-03-06Merge branch 'nox/maps-v3_codegen-sort-nil-keys'Björn-Egil Dahlberg
* nox/maps-v3_codegen-sort-nil-keys: Properly sort map pairs in v3_codegen
2014-03-06Merge branch 'nox/maps-complex-mixed-values'Björn-Egil Dahlberg
* nox/maps-complex-mixed-values: Properly order Kernel code for maps with mixed pairs
2014-03-06Merge branch 'nox/compiler/v3_core-comprehension-no-export'Björn Gustavsson
* nox/compiler/v3_core-comprehension-no-export: Do not export variables from comprehension cases in v3_core OTP-11770
2014-03-06Merge branch 'nox/compiler/beam_bool-not_boolean_expr'Björn Gustavsson
* nox/compiler/beam_bool-not_boolean_expr: Compile BIF calls and operator expressions to Core the same way Do not try to optimize non-boolean guards
2014-03-06Properly collect labels in put_map instructions in beam_jumpAnthony Ramine
Reported-by: Ulf Norell
2014-03-05Merge branch 'nox/compiler/beam_bool-bad-protected'Björn Gustavsson
* nox/compiler/beam_bool-bad-protected: Properly detect nonboolean protected expressions in beam_bool
2014-03-05Merge branch 'nox/compiler/live_opt-wait_timeout-nil'Björn Gustavsson
* nox/compiler/live_opt-wait_timeout-nil: Handle nil as a wait_timeout argument in beam_utils:live_opt/4
2014-03-05Merge branch 'nox/compiler/sys_core_fold-erlang-is_function-2'Björn Gustavsson
* nox/compiler/sys_core_fold-erlang-is_function-2: Do not mark all calls to erlang:is_function/2 as safe
2014-03-05Do not export variables from comprehension cases in v3_coreAnthony Ramine
Code like the following snippet could make the compiler crash: f() -> [X = a || false] ++ [X = a || false]. Reported-by: Ulf Norell
2014-03-05Do not try to optimize non-boolean guardsAnthony Ramine
Expressions such as erlang:'or'(bar, true) can make beam_bool crash if it tries to optimize them, as this code is not quite really written by users, no attempt to rewrite them more efficiently should be done, for simplicity's sake. Reported-by: Ulf Norell
2014-03-05Properly check label use in get_map_elements in beam_jumpAnthony Ramine
Reported-by: Ulf Norell
2014-03-04Support maps in cerl_clauses:match/2Anthony Ramine
Without this, sys_core_fold could crash on non-matching clauses using maps patterns. Reported-by: Ulf Norell
2014-03-04Properly order Kernel code for maps with mixed pairsAnthony Ramine
The Kernel instructions were not properly ordered when compiling maps with complex values mixed in assoc and exact pairs. Reported-by: Ulf Norell
2014-03-04Properly sort map pairs in v3_codegenAnthony Ramine
Literal nil values aren't tagged tuple but the bare atom nil. The function lists:sort/2 expects the passed function to return true if the first element is less than or equal to the second, not strictly less than. The original base clause is changed accordingly. Reported-by: Ulf Norell
2014-03-04Merge branch 'nox/maps-fix-beam_bool-put_map'Björn-Egil Dahlberg
* nox/maps-fix-beam_bool-put_map: Properly collect labels in put_map instructions in beam_bool
2014-03-04Merge branch 'nox/maps-expand-update'Björn-Egil Dahlberg
* nox/maps-expand-update: Fix expansion of map update arguments
2014-03-04Merge branch 'nox/compiler/v3_core-mismatched-apply'Björn Gustavsson
* nox/compiler/v3_core-mismatched-apply: Do not emit blatantly illformed Core Erlang apply expressions
2014-03-04Handle nil as a wait_timeout argument in beam_utils:live_opt/4Anthony Ramine
Reported-by: Ulf Norell
2014-03-04Properly detect nonboolean protected expressions in beam_boolAnthony Ramine
Silly code such as the following could make the compiler crash: f() when erlang:float(self()); true -> ok. Reported-by: Ulf Norell
2014-03-03Properly collect labels in put_map instructions in beam_boolAnthony Ramine
Reported-by: Ulf Norell
2014-03-03Do not mark all calls to erlang:is_function/2 as safeAnthony Ramine
Calls to erlang:is_function/2 where the second is not a literal nonnegative integer can crash at runtime and thus can't be marked as safe.