diff options
author | Björn Gustavsson <[email protected]> | 2012-01-26 10:43:49 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-01-26 10:43:49 +0100 |
commit | 0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6 (patch) | |
tree | 744ceaaa73408578a26171118a9aa09ac8311144 /lib/stdlib/src/erl_lint.erl | |
parent | 716f6e4c99dd03ee48087bbebe37bfb42c08835e (diff) | |
parent | 9d2a2e3db06e861045e51ca3cc8adb9cf8fc467d (diff) | |
download | otp-0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6.tar.gz otp-0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6.tar.bz2 otp-0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6.zip |
Merge branch 'maint'
* maint:
Update primary bootstrap
erl_lint: Disallow call to is_record/3 if there is a local is_record/3
Fix crash in trace_info({M,F,A}, Flags) when M:F/A has native code
Ensure that generated record operations don't call local functions
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 2f29954dc9..cfbcf54d95 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -1808,7 +1808,7 @@ guard_test2({call,Line,{atom,_La,F},As}=G, Vt, St0) -> {Asvt,St1} = gexpr_list(As, Vt, St0), %Always check this. A = length(As), case erl_internal:type_test(F, A) of - true when F =/= is_record -> + true when F =/= is_record, A =/= 2 -> case no_guard_bif_clash(St1, {F,A}) of false -> {Asvt,add_error(Line, {illegal_guard_local_call,{F,A}}, St1)}; @@ -1872,9 +1872,15 @@ gexpr({call,Line,{atom,_Lr,is_record},[E,R]}, Vt, St0) -> gexpr({call,Line,{remote,_Lr,{atom,_Lm,erlang},{atom,Lf,is_record}},[E,A]}, Vt, St0) -> gexpr({call,Line,{atom,Lf,is_record},[E,A]}, Vt, St0); -gexpr({call,_Line,{atom,_Lr,is_record},[E,{atom,_,_Name},{integer,_,_}]}, +gexpr({call,Line,{atom,_Lr,is_record},[E0,{atom,_,_Name},{integer,_,_}]}, Vt, St0) -> - gexpr(E, Vt, St0); + {E,St1} = gexpr(E0, Vt, St0), + case no_guard_bif_clash(St0, {is_record,3}) of + true -> + {E,St1}; + false -> + {E,add_error(Line, {illegal_guard_local_call,{is_record,3}}, St1)} + end; gexpr({call,Line,{atom,_Lr,is_record},[_,_,_]=Asvt0}, Vt, St0) -> {Asvt,St1} = gexpr_list(Asvt0, Vt, St0), {Asvt,add_error(Line, illegal_guard_expr, St1)}; |