aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2011-02-15 12:14:59 +0100
committerBjörn-Egil Dahlberg <[email protected]>2011-02-15 12:14:59 +0100
commit8f2e4436b6475f428fa32ac156117e023f1cc179 (patch)
tree8b129245c5119dd7b896a41777f2f73accc515d6 /lib/stdlib/src
parent241843492d2ac60ec52dbea1e8b2459c3a17106a (diff)
parent6f260c38ce2a75d86dbd4348e973ffca629d331b (diff)
downloadotp-8f2e4436b6475f428fa32ac156117e023f1cc179.tar.gz
otp-8f2e4436b6475f428fa32ac156117e023f1cc179.tar.bz2
otp-8f2e4436b6475f428fa32ac156117e023f1cc179.zip
Merge branch 'egil/io-badarg/OTP-9045' into dev
* egil/io-badarg/OTP-9045: Fix exception generation in the io module
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/io.erl18
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/stdlib/src/io.erl b/lib/stdlib/src/io.erl
index 78412ab2bc..3efa68ca09 100644
--- a/lib/stdlib/src/io.erl
+++ b/lib/stdlib/src/io.erl
@@ -55,26 +55,12 @@
to_tuple(T) when is_tuple(T) -> T;
to_tuple(T) -> {T}.
-%% Problem: the variables Other, Name and Args may collide with surrounding
-%% ones.
-%% Give extra args to macro, being the variables to use.
--define(O_REQUEST(Io, Request),
- case request(Io, Request) of
- {error, Reason} ->
- [Name | Args] = tuple_to_list(to_tuple(Request)),
- erlang:error(conv_reason(Name, Reason), [Name, Io | Args]);
- Other ->
- Other
- end).
-
o_request(Io, Request, Func) ->
case request(Io, Request) of
{error, Reason} ->
[_Name | Args] = tuple_to_list(to_tuple(Request)),
- {'EXIT',{undef,[_Current|Mfas]}} = (catch erlang:error(undef)),
- MFA = {io, Func, [Io | Args]},
- exit({conv_reason(Func, Reason),[MFA|Mfas]});
-% erlang:error(conv_reason(Name, Reason), [Name, Io | Args]);
+ {'EXIT',{get_stacktrace,[_Current|Mfas]}} = (catch erlang:error(get_stacktrace)),
+ erlang:raise(error, conv_reason(Func, Reason), [{io, Func, [Io | Args]}|Mfas]);
Other ->
Other
end.