Files
mercury/tests/hard_coded/deep_copy_bug.m
Fergus Henderson 05be512793 Fix a bug that Tom reported where calling solutions/3 with an
Estimated hours taken: 2

Fix a bug that Tom reported where calling solutions/3 with an
equivalence type caused a crash in deep_copy().

runtime/deep_copy.c:
	Fix a bug in the copying of equivalence types and no_tag types.
	It was using `entry_value' instead of `entry_value[1]'.

tests/hard_coded/Mmake:
tests/hard_coded/.cvsignore:
tests/hard_coded/deep_copy_bug.m:
tests/hard_coded/deep_copy_bug.exp:
	Add a regression test for this bug.
1997-04-10 16:05:13 +00:00

27 lines
568 B
Mathematica

% This is a regression test.
% The Mercury compiler of Apr 11 1997 failed for this in non-gc grades,
% because of a bug in deep_copy() of equivalence types.
:- module deep_copy_bug.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module int, std_util, list, term, varset.
main -->
{ Lambda = lambda([X::out] is nondet,
(
varset__init(Varset0),
varset__new_vars(Varset0, 10, Vars, _),
list__member(X, Vars)
)) },
{ solutions(Lambda, List) },
io__write(List),
io__write_string("\n").