[m-dev.] diff: fix unaligned strings

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Tue Apr 20 22:31:03 AEST 1999


Estimated hours taken: 1

trace/mercury_trace_declarative.c:
	Ensure strings are aligned before passing them to Mercury code.

Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.5
diff -u -r1.5 mercury_trace_declarative.c
--- mercury_trace_declarative.c	1999/04/16 03:08:14	1.5
+++ mercury_trace_declarative.c	1999/04/16 06:55:35
@@ -521,15 +521,23 @@
 static ConstString
 MR_edt_root_node_name(const MR_Stack_Layout_Entry *entry)
 {
+	ConstString	name;
+
 	if (MR_ENTRY_LAYOUT_HAS_PROC_ID(entry)) {
 		if (MR_ENTRY_LAYOUT_COMPILER_GENERATED(entry)) {
-			return (ConstString) "(internal)";
+			MR_TRACE_USE_HP(
+				make_aligned_string(name, "(internal)");
+			);
 		} else {
-			return entry->MR_sle_proc_id.MR_proc_user.MR_user_name;
+			name = entry->MR_sle_proc_id.MR_proc_user.MR_user_name;
 		}
 	} else {
-		return (ConstString) "(unknown)";
+		MR_TRACE_USE_HP(
+			make_aligned_string(name, "(unknown)");
+		);
 	}
+
+	return name;
 }
 
 static Word
-- 
Mark Brown  (dougl at cs.mu.oz.au)       )O+   |  For Microsoft to win,
MEngSc student,                             |  the customer must lose
Dept of Computer Science, Melbourne Uni     |          -- Eric S. Raymond
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list