diff: bug fix for io__tmpnam/5

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 4 18:18:07 AEDT 1998


library/io.m:
	Fix a bug in the code for io__tmpnam/5:
	it was calling incr_saved_hp() from `pragma c_code',
	when it should have been calling incr_hp(). 
	This caused the test case tests/hard_coded/remove_file to fail.

Index: io.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/io.m,v
retrieving revision 1.148
diff -u -u -r1.148 io.m
--- 1.148	1998/01/24 17:20:13
+++ io.m	1998/02/04 07:14:52
@@ -2677,7 +2677,7 @@
 	if (tmp  == NULL) {
 		fatal_error(""unable to create temporary filename"");
 	}
-	incr_saved_hp_atomic(LVALUE_CAST(Word *,FileName),
+	incr_hp_atomic(LVALUE_CAST(Word *,FileName),
 		(strlen(tmp) + sizeof(Word)) / sizeof(Word));
 	strcpy(FileName, tmp);
 	free(tmp);
@@ -2695,7 +2695,7 @@
 	struct stat buf;
 
 	len = strlen(Dir) + 1+ 5 + 3 + 1; /* Dir + / + Prefix + counter + \\0 */
-	incr_saved_hp_atomic(LVALUE_CAST(Word *,FileName),
+	incr_hp_atomic(LVALUE_CAST(Word *,FileName),
 		(len + sizeof(Word)) / sizeof(Word));
 	if (ML_io_tempnam_counter == 0)
 		ML_io_tempnam_counter = getpid();

-- 
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