[m-dev.] diff: fix bugs that broke `jump' and `fast' grades
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Oct 13 17:00:42 AEST 1999
Estimated hours taken: 3
Fix problems that broke the `jump' and `fast' grades.
library/builtin.m:
library/private_builtin.m:
library/array.m:
library/std_util.m:
Use MR_MAYBE_STATIC_CODE() in initializers for type_ctor_infos,
to avoid a compilation error when code addresses are not valid
initializers. Call MR_INIT_TYPE_CTOR_INFO() to ensure that the
type_ctor_infos for c_pointer, type_info, type_ctor_info,
typeclass_info, base_typeclass_info, array, and univ are
initialized at runtime if they can't be initialized statically.
Workspace: /d-drive/home/hg/fjh/mercury
Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.59
diff -u -r1.59 array.m
--- library/array.m 1999/09/27 05:20:30 1.59
+++ library/array.m 1999/10/13 05:59:28
@@ -284,9 +284,9 @@
MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
mercury_data_array__type_ctor_info_array_1 = {
(Integer) 1,
- ENTRY(mercury____Unify___array__array_1_0),
- ENTRY(mercury____Index___array__array_1_0),
- ENTRY(mercury____Compare___array__array_1_0),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Unify___array__array_1_0)),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Index___array__array_1_0)),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Compare___array__array_1_0)),
MR_TYPECTOR_REP_ARRAY,
(Word *) &mercury_data_array__type_ctor_functors_array_1,
(Word *) &mercury_data_array__type_ctor_layout_array_1,
@@ -338,11 +338,16 @@
/*
INIT sys_init_array_module_builtins
*/
+
+extern ModuleFunc array_module_builtins;
+
void sys_init_array_module_builtins(void);
/* suppress gcc -Wmissing-decl warning */
void sys_init_array_module_builtins(void) {
- extern ModuleFunc array_module;
array_module_builtins();
+ MR_INIT_TYPE_CTOR_INFO(
+ mercury_data_array__type_ctor_info_array_1,
+ array__array_1_0);
}
").
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.21
diff -u -r1.21 builtin.m
--- library/builtin.m 1999/10/08 02:56:06 1.21
+++ library/builtin.m 1999/10/13 06:05:47
@@ -875,9 +875,9 @@
const struct MR_TypeCtorInfo_struct
mercury_data_builtin__type_ctor_info_c_pointer_0 = {
(Integer) 0,
- ENTRY(mercury____Unify___builtin__c_pointer_0_0),
- ENTRY(mercury____Index___builtin__c_pointer_0_0),
- ENTRY(mercury____Compare___builtin__c_pointer_0_0),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Unify___builtin__c_pointer_0_0)),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Index___builtin__c_pointer_0_0)),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Compare___builtin__c_pointer_0_0)),
MR_TYPECTOR_REP_C_POINTER,
(MR_TypeCtorFunctors) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
(MR_TypeCtorLayout) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
@@ -926,6 +926,9 @@
/* duplicate declaration to suppress gcc -Wmissing-decl warning */
void sys_init_unify_c_pointer_module(void) {
unify_c_pointer_module();
+ MR_INIT_TYPE_CTOR_INFO(
+ mercury_data_builtin__type_ctor_info_c_pointer_0,
+ builtin__c_pointer_0_0);
}
").
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.29
diff -u -r1.29 private_builtin.m
--- library/private_builtin.m 1999/09/27 05:20:34 1.29
+++ library/private_builtin.m 1999/10/13 05:54:01
@@ -480,6 +480,19 @@
void sys_init_type_info_module(void); /* suppress gcc -Wmissing-decl warning */
void sys_init_type_info_module(void) {
type_info_module();
+
+ MR_INIT_TYPE_CTOR_INFO(
+ mercury_data_private_builtin__type_ctor_info_type_ctor_info_1,
+ private_builtin__type_info_1_0);
+ MR_INIT_TYPE_CTOR_INFO(
+ mercury_data_private_builtin__type_ctor_info_type_info_1,
+ private_builtin__type_info_1_0);
+ MR_INIT_TYPE_CTOR_INFO(
+ mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1,
+ private_builtin__typeclass_info_1_0);
+ MR_INIT_TYPE_CTOR_INFO(
+ mercury_data_private_builtin__type_ctor_info_typeclass_info_1,
+ private_builtin__typeclass_info_1_0);
}
").
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.161
diff -u -r1.161 std_util.m
--- library/std_util.m 1999/10/08 02:56:09 1.161
+++ library/std_util.m 1999/10/13 05:45:21
@@ -1095,9 +1095,9 @@
MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
mercury_data_std_util__type_ctor_info_univ_0 = {
(Integer) 0,
- ENTRY(mercury____Unify___std_util__univ_0_0),
- ENTRY(mercury____Index___std_util__univ_0_0),
- ENTRY(mercury____Compare___std_util__univ_0_0),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Unify___std_util__univ_0_0)),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Index___std_util__univ_0_0)),
+ MR_MAYBE_STATIC_CODE(ENTRY(mercury____Compare___std_util__univ_0_0)),
MR_TYPECTOR_REP_UNIV,
(Word *) &mercury_data_std_util__type_ctor_functors_univ_0,
(Word *) &mercury_data_std_util__type_ctor_layout_univ_0,
@@ -1296,6 +1296,9 @@
void sys_init_unify_univ_module(void); /* suppress gcc -Wmissing-decl warning */
void sys_init_unify_univ_module(void) {
unify_univ_module();
+
+ MR_INIT_TYPE_CTOR_INFO(mercury_data_std_util__type_ctor_info_univ_0,
+ std_util__univ_0_0);
}
").
@@ -1909,6 +1912,7 @@
list_arg_type_info = MR_field(MR_mktag(0),
MR_list_head(arg_list), UNIV_OFFSET_FOR_TYPEINFO);
+ /* XXX need to handle existential types */
arg_type_info = (Word) MR_create_type_info(
(Word *) type_info, (Word *) arg_vector[i]);
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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