mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
47 lines
1.5 KiB
Mathematica
47 lines
1.5 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% This is a regression test. The 17-Nov-2002 version of the compiler got
|
|
% a runtime abort in the declarative debugger for the associated input script.
|
|
% The bug occurred during the conversion to typeinfos of the pseudotypeinfos
|
|
% describing xmap__init's two input arguments, TypeInfo_for_K and
|
|
% TypeInfo_for_V.
|
|
%
|
|
% The problem was caused by the type private_builtin:typeinfo being declared
|
|
% to have arity 1, when its true arity is variable, with the actual argument
|
|
% values being unused by the runtime system. At the call event of xmap_init,
|
|
% the types of the typeinfos include unbound type variables (K and V); the
|
|
% runtime system tried to follow a NULL pointer when attempting to look up
|
|
% the identities of the typeinfos bound to these type variables.
|
|
|
|
:- module mapinit.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module tree234.
|
|
|
|
:- type xmap(K, V) == tree234(K, V).
|
|
|
|
main -->
|
|
{ xmap_init(Init) },
|
|
{ xmap_set(Init, 0, "zero", Map) },
|
|
io__write(Map),
|
|
io__nl.
|
|
|
|
:- pred xmap_init(xmap(K, V)::out) is det.
|
|
|
|
xmap_init(Init) :-
|
|
tree234__init(Init).
|
|
|
|
:- pred xmap_set(xmap(K, V)::in, K::in, V::in, xmap(K, V)::out) is det.
|
|
|
|
xmap_set(Map0, Key, Value, Map) :-
|
|
tree234__set(Key, Value, Map0, Map).
|