Skip to content

“n - n mod CONST” gives internal error on x86-64/win64 with overflow checks.

Your foot trap, sir.

After 0ba4cee2, this code:

{$overflowchecks on}
var
	n: SizeUint;
begin
	n := 14 + random(0);
	n := n - n mod 4;
	writeln(n);
end.

gives Internal error 200109225 on x86-64/win64. All of the following works: i386/win32, signed type, manually replacing n := n - n mod 4; with n := n div 4 * 4.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information