diff options
author | Björn Gustavsson <[email protected]> | 2013-02-11 14:30:41 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-11 14:30:41 +0100 |
commit | 5cbedbd6534c4438e8f7e3eb7b0bf4649cdd4b0c (patch) | |
tree | 3d335fb6682afb36b2f76bbf8b57b55d212bb89b /lib/stdlib/src | |
parent | ca97661807e3b986d1c1b84d92c69c51a3dcbf04 (diff) | |
parent | 6b456e94d11ffe8a9f2e361fe8143902a2b99baf (diff) | |
download | otp-5cbedbd6534c4438e8f7e3eb7b0bf4649cdd4b0c.tar.gz otp-5cbedbd6534c4438e8f7e3eb7b0bf4649cdd4b0c.tar.bz2 otp-5cbedbd6534c4438e8f7e3eb7b0bf4649cdd4b0c.zip |
Merge branch 'bjorn/remove-tuple-funs/OTP-10170'
* bjorn/remove-tuple-funs/OTP-10170:
erl_eval: Don't allow evaluation of {M,F} in the shell
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/erl_eval.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stdlib/src/erl_eval.erl b/lib/stdlib/src/erl_eval.erl index 1c3f91cbfc..0b57af1b6d 100644 --- a/lib/stdlib/src/erl_eval.erl +++ b/lib/stdlib/src/erl_eval.erl @@ -346,7 +346,12 @@ expr({call,_,{atom,_,Func},As0}, Bs0, Lf, Ef, RBs) -> expr({call,_,Func0,As0}, Bs0, Lf, Ef, RBs) -> % function or {Mod,Fun} {value,Func,Bs1} = expr(Func0, Bs0, Lf, Ef, none), {As,Bs2} = expr_list(As0, Bs1, Lf, Ef), - do_apply(Func, As, Bs2, Ef, RBs); + case Func of + {M,F} when is_atom(M), is_atom(F) -> + erlang:raise(error, {badfun,Func}, stacktrace()); + _ -> + do_apply(Func, As, Bs2, Ef, RBs) + end; expr({'catch',_,Expr}, Bs0, Lf, Ef, RBs) -> Ref = make_ref(), case catch {Ref,expr(Expr, Bs0, Lf, Ef, none)} of |