[m-rev.] diff: fix bug compiling updated _init.erl files

Peter Wang wangp at students.csse.unimelb.edu.au
Fri Aug 17 15:40:17 AEST 2007


Estimated hours taken: 0.2
Branches: main

compiler/compile_target_code.m:
	Fix an inverted comparison which caused updated _init.erl files not
	to be compiled to the respective .beam file.

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.116
diff -u -p -r1.116 compile_target_code.m
--- compiler/compile_target_code.m	31 Jul 2007 07:58:41 -0000	1.116
+++ compiler/compile_target_code.m	17 Aug 2007 05:37:06 -0000
@@ -1337,7 +1337,7 @@ maybe_compile_init_obj_file(MaybeInitTar
     globals.io_lookup_bool_option(statistics, Stats, !IO),
     (
         MaybeInitTargetFile = yes(InitTargetFileName),
-        file_as_new_as(InitTargetFileName, InitObjFileName, UpToDate, !IO),
+        file_as_new_as(InitObjFileName, InitTargetFileName, UpToDate, !IO),
         (
             ( MustCompile = yes
             ; UpToDate = no
@@ -1362,6 +1362,11 @@ maybe_compile_init_obj_file(MaybeInitTar
         Result = no
     ).
 
+    % file_as_new_as(FileNameA, FileNameB, IsAsNew, !IO)
+    %
+    % IsAsNew is `yes' iff file A has a timestamp at least as new as the
+    % timestamp of file B.
+    %
 :- pred file_as_new_as(file_name::in, file_name::in, bool::out,
     io::di, io::uo) is det.
 
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list