aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-11-06 10:48:02 +0100
committerFredrik Gustafsson <[email protected]>2013-11-06 10:48:02 +0100
commit0b13c6cbfff58f928778428deb6862a7744416bb (patch)
tree7d3ec45c61a22899073d912603b7bebe55d04b6a /lib/xmerl/src
parent84fd7aa216f0f7f2a1d891b1f0cb1461272dc727 (diff)
parentd64c016b8453ac143a6c26493a0fb1908f34ed99 (diff)
downloadotp-0b13c6cbfff58f928778428deb6862a7744416bb.tar.gz
otp-0b13c6cbfff58f928778428deb6862a7744416bb.tar.bz2
otp-0b13c6cbfff58f928778428deb6862a7744416bb.zip
Merge branch 'richcarl/xmerl-avoid-code-server-serialization/OTP-11463' into maint
* richcarl/xmerl-avoid-code-server-serialization/OTP-11463: Avoid serialization on code_server in xmerl:export()
Diffstat (limited to 'lib/xmerl/src')
-rw-r--r--lib/xmerl/src/xmerl.erl25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/xmerl/src/xmerl.erl b/lib/xmerl/src/xmerl.erl
index 3249094e78..01af183eef 100644
--- a/lib/xmerl/src/xmerl.erl
+++ b/lib/xmerl/src/xmerl.erl
@@ -303,18 +303,17 @@ apply_tag_cb(Ms, F, Args) ->
apply_cb(Ms, F, '#element#', Args).
apply_cb(Ms, F, Df, Args) ->
- apply_cb(Ms, F, Df, Args, Ms).
-
-apply_cb([M|Ms], F, Df, Args, Ms0) ->
- case catch apply(M, F, Args) of
- {'EXIT', {undef,[{M,F,_,_}|_]}} ->
- apply_cb(Ms, F, Df, Args, Ms0);
- {'EXIT', Reason} ->
- exit(Reason);
- Res ->
- Res
+ apply_cb(Ms, F, Df, Args, length(Args)).
+
+apply_cb(Ms, F, Df, Args, A) ->
+ apply_cb(Ms, F, Df, Args, A, Ms).
+
+apply_cb([M|Ms], F, Df, Args, A, Ms0) ->
+ case erlang:function_exported(M, F, A) of
+ true -> apply(M, F, Args);
+ false -> apply_cb(Ms, F, Df, Args, A, Ms0)
end;
-apply_cb([], Df, Df, Args, _Ms0) ->
+apply_cb([], Df, Df, Args, A, _Ms0) ->
exit({unknown_tag, {Df, Args}});
-apply_cb([], F, Df, Args, Ms0) ->
- apply_cb(Ms0, Df, Df, [F|Args]).
+apply_cb([], F, Df, Args, A, Ms0) ->
+ apply_cb(Ms0, Df, Df, [F|Args], A+1).