Files
mercury/tests/hard_coded/prince_frameopt.m
Zoltan Somogyi 33eb3028f5 Clean up the tests in half the test directories.
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.
2015-02-14 20:14:03 +11:00

39 lines
1.3 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Versions of the compiler up to April 19, 2006 had a bug that caused this
% program to crash. The bug was that when frameopt wanted to find out whether
% a block of instructions referred to stack variables, it did not look past
% pragma_c_code LLDS instructions. As a result, the generated code included
% a (redundant) assignment to a stack variable in a section of code that,
% after frameopt, did not have a stack frame anymore. It therefore overwrote
% part of its caller's stack frame, which caused a crash.
%
% The bug showed up in YesLogic's Prince, and was isolated to this test case
% by Michael Day. The bug actually occurred when optimizing get_max_width in
% prince_frameopt_css.style.m.
:- module prince_frameopt.
:- interface.
:- import_module io.
:- pred main(io, io).
:- mode main(di, uo) is det.
:- implementation.
:- import_module string.
:- import_module prince_frameopt_css.
:- import_module prince_frameopt_css.style.
main(!IO) :-
write_string("About to crash\n", !IO),
PRules = new_prules,
write(PRules, !IO),
nl(!IO),
write_string("Done\n", !IO).