strange behavior of ":i"

Levent Erkok erkok@cse.ogi.edu
Sun, 6 Jan 2002 23:52:31 +0000


Hugs version: Out of the CVS repository.

Load this file: (the syntax error is intentional.)
----------------------------------------------------
import IO
 
x=
----------------------------------------------------

After Hugs complains that there's an error (rightly
so), type this:

----------------------------------------------------
IO> :i IORef      
----------------------------------------------------

Hugs goes into an infinite loop.

I've looked at the code a bit. It dies down in the call
to findName, on line 1810 of hugs.c. This call never
returns.

Also, two if statements on lines 1797 and 1798 of hugs.c
look suspicious:

   if (!mod) { free(mod); mod = NULL; }          
   if (!nm)  { free(nm);  nm  = NULL; }

Looks like the tests are inverted. (The above bug is not 
caused by this, even when I remove the !'s, it still goes 
into an infinite loop.)

I've tried compiling after setting WANT_FIXED_SIZE_TABLES
to 1 in prelude.h, but still the same.

What's strange is that I can't repeat the bug using any 
other import (i.e. anything other than IO), or without 
causing a syntax error in the file. Really weird.

-Levent.