Generate a more informative message for an abort.

Estimated hours taken: 0.1
Branches: main

runtime/mercury_deep_copy_body.h:
	Generate a more informative message for an abort.
This commit is contained in:
Zoltan Somogyi
2005-03-23 00:48:56 +00:00
parent 148f103515
commit bc0efc1de9

View File

@@ -2,7 +2,7 @@
** vim: ts=4 sw=4 expandtab
*/
/*
** Copyright (C) 1997-2004 The University of Melbourne.
** Copyright (C) 1997-2005 The University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/
@@ -686,7 +686,16 @@ try_again:
**
** We don't know how to copy it, so we have to abort.
*/
MR_fatal_error("Cannot copy foreign type");
char *buf;
int len;
len = strlen(type_ctor_info->MR_type_ctor_module_name) +
strlen(type_ctor_info->MR_type_ctor_name) + 100;
buf = (char *) MR_malloc(len);
sprintf(buf, "Cannot copy foreign type %s.%s",
type_ctor_info->MR_type_ctor_module_name,
type_ctor_info->MR_type_ctor_name);
MR_fatal_error(buf);
}
}
return new_data;