Fix a bug in petdr's recent changes to string__format that

Estimated hours taken: 1.5

Fix a bug in petdr's recent changes to string__format that
broke things in non-gc grades on sparcs.

runtime/mercury_string.c:
	In MR_make_string(), wrap calls to restore/save_transient_hp()
	around the call to MR_make_aligned_string_msg(), as mentioned
	in the documentation for MR_make_aligned_string_msg().

runtime/mercury_string.h:
	Document that calls to MR_make_string need to be wrapped inside
	calls to save/restore_transient_hp().

library/string.m:
	Wrap calls to MR_make_string inside calls to
	save/restore_transient_hp().
This commit is contained in:
Fergus Henderson
2000-09-14 15:24:51 +00:00
parent 6385aed399
commit 31eadee813
3 changed files with 12 additions and 5 deletions

View File

@@ -74,9 +74,10 @@ MR_make_string(MR_Code *proclabel, const char *fmt, ...) {
p = fixed;
#endif
restore_transient_hp();
MR_allocate_aligned_string_msg(result, strlen(p),
proclabel);
save_transient_hp();
strcpy(result, p);
#ifdef HAVE_VSNPRINTF