From e36b171c318ba8c475fe0727fe2d0d35f86a4a73 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Tue, 27 Sep 2011 13:07:47 +0200 Subject: Fix bug in dataflow --- lib/dialyzer/src/dialyzer_dataflow.erl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 659297f993..d74c04385b 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -1399,10 +1399,14 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, true -> Any = t_any(), [Any || _ <- Pats]; false -> t_to_tlist(OrigArgType) end, - case bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1) of - {error, bind, _, _, _} -> {{pattern_match, PatTypes}, false}; - {_, _} -> {{pattern_match_cov, PatTypes}, false} - end; + Tag = + case bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1) of + {error, bind, _, _, _} -> pattern_match; + {error, record, _, _, _} -> record_match; + {error, opaque, _, _, _} -> opaque_match; + {_, _} -> pattern_match_cov + end, + {{Tag, PatTypes}, false}; false -> %% Try to find out if this is a default clause in a list %% comprehension and supress this. A real Hack(tm) @@ -1442,12 +1446,12 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, opaque -> [PatString, format_type(Type, State1), format_type(OpaqueTerm, State1)] end, - FailedMsg = case ErrorType of - bind -> {pattern_match, PatTypes}; - record -> {record_match, PatTypes}; - opaque -> {opaque_match, PatTypes} + FailedTag = case ErrorType of + bind -> pattern_match; + record -> record_match; + opaque -> opaque_match end, - {FailedMsg, Force0} + {{FailedTag, PatTypes}, Force0} end, WarnType = case Msg of {opaque_match, _} -> ?WARN_OPAQUE; -- cgit v1.2.3 From 7fc2604feb7d3887eb9271d1b9ef38e99db5176b Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Tue, 27 Sep 2011 20:04:29 +0300 Subject: Decrease tuple arity limit This fixes a memory related crash. --- lib/hipe/cerl/erl_types.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 1748c1cc16..0a76938799 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -242,7 +242,7 @@ -define(REC_TYPE_LIMIT, 2). -define(TUPLE_TAG_LIMIT, 5). --define(TUPLE_ARITY_LIMIT, 10). +-define(TUPLE_ARITY_LIMIT, 8). -define(SET_LIMIT, 13). -define(MAX_BYTE, 255). -define(MAX_CHAR, 16#10ffff). -- cgit v1.2.3 From 39a3e0aa40eb75f5780c4c0964343c046955adec Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Tue, 27 Sep 2011 20:10:22 +0300 Subject: Remove unused macro --- lib/hipe/cerl/erl_types.erl | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 0a76938799..15c923e3c7 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -247,7 +247,6 @@ -define(MAX_BYTE, 255). -define(MAX_CHAR, 16#10ffff). --define(WIDENING_LIMIT, 7). -define(UNIT_MULTIPLIER, 8). -define(TAG_IMMED1_SIZE, 4). -- cgit v1.2.3 From e4d5a206975e7718f6a95d5610ddc45b1d801c49 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Wed, 28 Sep 2011 09:04:04 +0300 Subject: Fix typer's crash for nonexisting files ... and do some small cleanups. --- lib/typer/src/typer.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/typer/src/typer.erl b/lib/typer/src/typer.erl index e40c4f39cd..16ef7f03c2 100644 --- a/lib/typer/src/typer.erl +++ b/lib/typer/src/typer.erl @@ -466,14 +466,20 @@ write_typed_file(File, Info) -> case file:make_dir(TyperAnnDir) of {error, Reason} -> case Reason of - eexist -> %% TypEr dir exists; remove old typer files - ok = file:delete(NewFileName), + eexist -> %% TypEr dir exists; remove old typer files if they exist + case file:delete(NewFileName) of + ok -> ok; + {error, enoent} -> ok; + {error, _} -> + Msg = io_lib:format("Error in deleting file ~s\n", [NewFileName]), + fatal_error(Msg) + end, write_typed_file(File, Info, NewFileName); enospc -> Msg = io_lib:format("Not enough space in ~p\n", [Dir]), fatal_error(Msg); eacces -> - Msg = io:format("No write permission in ~p\n", [Dir]), + Msg = io_lib:format("No write permission in ~p\n", [Dir]), fatal_error(Msg); _ -> Msg = io_lib:format("Unhandled error ~s when writing ~p\n", -- cgit v1.2.3