[erlang-patches] Fix TypEr crash when used with several source files

Ricardo Catalinas Jiménez jimenezrick@REDACTED
Fri Mar 11 01:06:29 CET 2011


My patch is based on the new version of TypEr, v0.9, derived from the
latest commit on `dev' branch.

The problem is present in the old version and the new one, because the
same erroneous line of code is there. The fix is the same in both
versions (just diferent line number).


The commit message explains all the details of the issue:

http://github.com/jimenezrick/otp/commit/6d0fa8efb709fa9351e11f99f609919921d256d8


The easiest way to test the bug is to run TypEr on several files in
one shot with the  directory `
typer_ann' not yet created:

    typer --plt <your_plt>   *.erl

Because TypEr will try to remove any old version of  .ann.erl files
that maybe exist, but in this case any of those file are not present
so, this line will crash:

    ok = file:delete(OldTyperAnnFile),

We must let the possibility that there is not old file there:

    file:delete(OldTyperAnnFile),

It's a very little fix.


On Thu, Mar 10, 2011 at 11:21 PM, Kostis Sagonas <kostis@REDACTED> wrote:
> Ricardo Catalinas Jiménez wrote:
>>
>> Already reported bug, see http://www.erlang.org/cgi-bin/ezmlm-cgi/2/1604.
>>
>>
>> Please fetch:
>>
>> git fetch git://github.com/jimenezrick/otp.git fix-typer-delete
>
> There has been a major rewrite of typer for the upcoming R14B02 release.
> Can you please check whether the problem you/others experienced is still
> present and if so send me an appropriate test for this? (or re-submit your
> patch based on the current 'dev') ?
>
> Thanks,
> Kostis
>
>



-- 
Ricardo


More information about the erlang-patches mailing list