mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 04:44:39 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user