aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2011-07-05 10:10:02 +0200
committerHans Bolinder <[email protected]>2011-07-06 16:19:59 +0200
commit790d7218531957b1a2427432f4cbfc49f49b3566 (patch)
tree8d7c6a85939d6558003b6ca1cfed0343828ac11f /lib/stdlib/src
parentce834798d7f08d5869f11a1cb81e49ca7d5db3b8 (diff)
downloadotp-790d7218531957b1a2427432f4cbfc49f49b3566.tar.gz
otp-790d7218531957b1a2427432f4cbfc49f49b3566.tar.bz2
otp-790d7218531957b1a2427432f4cbfc49f49b3566.zip
Fix a bug in erl_scan:set_attribute/3
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/erl_scan.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stdlib/src/erl_scan.erl b/lib/stdlib/src/erl_scan.erl
index 718ca2e91a..10b2ed2e49 100644
--- a/lib/stdlib/src/erl_scan.erl
+++ b/lib/stdlib/src/erl_scan.erl
@@ -408,7 +408,12 @@ set_attr(line, {Line,Column}, Fun) when ?ALINE(Line), ?COLUMN(Column) ->
end;
set_attr(line=Tag, Attrs, Fun) when is_list(Attrs) ->
{line,Line} = lists:keyfind(Tag, 1, Attrs),
- lists:keyreplace(Tag, 1, Attrs, {line,Fun(Line)});
+ case lists:keyreplace(Tag, 1, Attrs, {line,Fun(Line)}) of
+ [{line,Ln}] when ?ALINE(Ln) ->
+ Ln;
+ As ->
+ As
+ end;
set_attr(T1, T2, T3) ->
erlang:error(badarg, [T1,T2,T3]).