Skip to content

“noreturn” crashes on x86-64

This code crashes on x86-64 with -O1 (not greater) while trying to free a temporary ansistring. It definitely didn’t crash some time ago, it doesn’t crash without noreturn (or with uses SysUtils, but I don’t want to), and there was a suspicious 0b3fb55c.

{$mode objfpc} {$longstrings on}
procedure ThrowException; noreturn;
begin
	raise TObject.Create;
end;

procedure DoSomethingWithString;
begin
	writeln(Copy('hey', 1, 2));
	ThrowException;
end;

begin
	try
		DoSomethingWithString;
	except
		writeln('catch');
	end;
end.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information