(0000222)
|
pjrm
|
2009-12-01 03:13
|
|
I've attached two files, nonempty12.m and call_nonempty12.m. The first is the one of interest, in that it compiles without error. The second is the obvious corresponding `main' predicate that segfaults when trying to access the first element of the list.
The test case is remarkably simple, not at all the highly specific circumstances I'd usually have for a Mercury compiler bug; I suppose then that it must be related to one of the several already-known limitations in the current mode system implementation.
I've tested with rotd-2009-02-26 on i686-pc-linux-gnu (Debian), with mgnuc=gcc-3.4.6, with both
`mmc --make --debug call_nonempty12 && ./call_nonempty12' and
`mmc --make --grade=hlc.gc call_nonempty12 && ./call_nonempty12'.
(Also tested with rotd-2007-12-16, so it's fairly long-standing.) |
|
(0000223)
|
wangp
|
2009-12-01 21:35
|
|
The problem is the following XXX.
inst_matches_final_3(ground(UniqA, HOInstInfoA), bound(UniqB, ListB),
MaybeType, !Info) :-
ModuleInfo = !.Info ^ imi_module_info,
\+ ho_inst_info_is_nonstandard_func_mode(ModuleInfo, HOInstInfoA),
unique_matches_final(UniqA, UniqB),
bound_inst_list_is_ground(ListB, MaybeType, ModuleInfo),
uniq_matches_bound_inst_list(UniqA, ListB, ModuleInfo),
(
MaybeType = yes(Type),
% We can only do this check if the type is known.
bound_inst_list_is_complete_for_type(set.init, ModuleInfo, ListB, Type)
;
true
% XXX enabling the check for bound_inst_list_is_complete
% for type makes the mode checker too conservative in
% the absence of alias tracking, so we currently always
% succeed, even if this check fails.
). |
|