[m-rev.] diff: --smart-recompilation and sub-modules bug

Peter Ross pro at missioncriticalit.com
Wed Mar 22 15:37:05 AEDT 2006


Hi,


===================================================================


Estimated hours taken: 0.5
Branches: main

Fix a compiler abort which was triggered when using --smart-recompilation
when compiling a sub-module which also imports one of its ancestor
modules.

compiler/recompilation.usage.m:
	Use svn_map.set instead of svn_map.det_insert when calling
	insert_into_imported_items_map as it is possible for this
	routine to be called twice with the same inputs.  This is
	because it's possible for visible_module to return the same
	answer twice (once as an ancestor module the second as an
	imported module), thus we will try and insert the data twice.

Index: compiler/recompilation.usage.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation.usage.m,v
retrieving revision 1.27
diff -U10 -r1.27 recompilation.usage.m
--- compiler/recompilation.usage.m	17 Mar 2006 01:40:39 -0000	1.27
+++ compiler/recompilation.usage.m	22 Mar 2006 04:28:26 -0000
@@ -507,21 +507,21 @@
 
 visible_modules(ModuleInfo, VisibleModule) :-
     visible_module(VisibleModule, ModuleInfo),
     \+ module_info_get_name(ModuleInfo, VisibleModule).
 
 :- pred insert_into_imported_items_map(module_name::in,
     imported_items::in, imported_items::out) is det.
 
 insert_into_imported_items_map(VisibleModule, !ImportedItemsMap) :-
     ModuleItems = init_item_id_set(set.init),
-    svmap.det_insert(VisibleModule, ModuleItems, !ImportedItemsMap).
+    svmap.set(VisibleModule, ModuleItems, !ImportedItemsMap).
 
     % Go over the set of imported items found to be used and
     % find the transitive closure of the imported items they use.
     %
 :- pred find_all_used_imported_items(module_info::in,
     used_items::in, map(item_id, set(item_id))::in,
     resolved_used_items::out, set(item_name)::out, imported_items::out,
     map(module_name, set(item_name))::out) is det.
 
 find_all_used_imported_items(ModuleInfo,

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list