From bc0efc1de973ff33ea07f506bda366eb773d372f Mon Sep 17 00:00:00 2001 From: Zoltan Somogyi Date: Wed, 23 Mar 2005 00:48:56 +0000 Subject: [PATCH] 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. --- runtime/mercury_deep_copy_body.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/runtime/mercury_deep_copy_body.h b/runtime/mercury_deep_copy_body.h index 9e6eb99df..1fd8a5911 100644 --- a/runtime/mercury_deep_copy_body.h +++ b/runtime/mercury_deep_copy_body.h @@ -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;