for review: bug fix for modules.m

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Feb 7 01:46:07 AEDT 1998


On 06-Feb-1998, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> Fix a bug reported by Tomas By which caused multiple
> definition errors when two modules use a third
> module, and one of the modules imports the other.
> 
> compiler/modules.m
> 	Delay processing of short interfaces until all long 
> 	interfaces have been read to avoid reading both
> 	the long and short interface for a module.

That change looks good, but I think adding a few comments would help.
Particularly at the following points:

> -	process_module_interfaces(["mercury_builtin" | ImportedModules], 
> -		[], Module1, Module2),
> +	process_module_interfaces_2(["mercury_builtin" | ImportedModules], 
> +		[], IndirectImports, Module1, Module2),
...
> -	process_module_interfaces(UsedModules, [], Module3, Module),
> +	process_module_interfaces(UsedModules, IndirectImports,
> +		Module3, Module),
>  
>  	{ Module = module_imports(_, _, _, _, Error) }.
...
> +process_module_interfaces(Imports, IndirectImports0, Module0, Module) -->
> +	process_module_interfaces_2(Imports, IndirectImports0,
> +		IndirectImports, Module0, Module1),
> +	process_module_short_interfaces(IndirectImports, Module1, Module).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list