This was sent in by David Fillmore today:
According to the Z-Machine specification:
"In Version 6, a width field may optionally be given: if this is non-zero, text will then be justified as if it were in the window with that number (if width is positive) or a box -width pixels wide (if negative). Then the table will contain not ordinary text but formatted text: see print_form."
Frotz, on the other hand, tries to get the width of a window of number -width if the value is <= 0, but passes the width value through directly if it is positive. This results in the interpreter crashing with an "Illegal window" error if the width value is less than -7.
Sample Inform6 code tickling this bug:
Switches v6;
Array formatted table 50;
[ main x;
@output_stream 3 formatted (-30); ! Frotz treats this as a window number and crashes.
print "ooh, hello there^boy^how are you";
@output_stream (-3);
@print_form formatted;
@read_char 1 -> x;
];
Taken from https://gitlab.com/DavidGriffith/frotz/-/issues/1:
This was sent in by David Fillmore today: According to the Z-Machine specification: "In Version 6, a width field may optionally be given: if this is non-zero, text will then be justified as if it were in the window with that number (if width is positive) or a box -width pixels wide (if negative). Then the table will contain not ordinary text but formatted text: see print_form." Frotz, on the other hand, tries to get the width of a window of number -width if the value is <= 0, but passes the width value through directly if it is positive. This results in the interpreter crashing with an "Illegal window" error if the width value is less than -7. Sample Inform6 code tickling this bug:
See also https://intfiction.org/t/output-stream-3-with-width-parameter-causes-interpreter-halt-z6/50659