New analysis case for Dialyzer ?

Mickael Remond mickael.remond@REDACTED
Sat Apr 9 10:47:35 CEST 2005


Hello,

Here is a piece of code that contains a bug: (* are marking the
interesting lines):

-=-=-=-
*   TS = To#psock.s,
     case From#psock.mode of
         expectheaders ->
             SSL = nossl,
             case yaws:http_get_headers(From#psock.s, SSL) of
                 {R, H0} ->
                     ?Debug("R = ~p~n",[R]),
                     RStr =
                         if
                             %% FIXME handle bad_request here
                             record(R, http_response) ->
                                 yaws_api:reformat_response(R);
                             record(R, http_request) ->
*                               To ! {cli2srv, R#http_request.method,
                                       H0#headers.host},
                                 yaws_api:reformat_request(
                                   rewrite_path(R, From#psock.prefix))
                         end,
-=-=-=-

The To variable is used as a record, but later on is used as a Pid.
I try to analyse the code with Dialyzer, but it did not suspect the
problem. Maybe analysis has been extended in the latest version of
Dialyzer (I did not try the brand new one), but I thought that actually
this piece of code might help the HiPE team.

Cheers,

-- 
Mickaël Rémond
  http://www.erlang-projects.org/




More information about the erlang-questions mailing list