Joseph Ferano
a431cddd3b
A divide by zero names the file and the line, and is answerable
...
Three arithmetic situations had no defined behaviour and the two backends
disagreed about all three: a divide or remainder by zero, which was a raw
SIGFPE with no message and no location; (/ min -1), whose quotient is one past
the top of the type; and a float to integer cast whose value does not fit,
which LLVM called undefined and would fold to anything.
They now signal ArithError with `error`, exactly as a bad index signals
BoundsError, and die with a sentence naming the file, the line and the operands
only if nothing answered. The guards ride the same --checks flag as the bounds
check and are elided with it.
No restart is established at the failing operation. The sketch this started
from asked for use-value, and the implementation ruled it out: a restart frame
is allocated by the restart-case that offers it, on its own stack, so the
runtime cannot hold one on a program's behalf and use-value here would mean an
alloca and a restart frame at every division in every checked build. That is
the cost already refused for indexing, buying a silently different answer.
The x86 backend is unchanged and is the next commit.
2026-09-13 22:55:26 +07:00
..
2026-09-12 11:36:01 +07:00
2026-09-13 15:40:08 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 10:47:41 +07:00
2026-09-12 05:32:25 +07:00
2026-09-13 14:49:11 +07:00
2026-09-12 10:55:18 +07:00
2026-09-13 22:55:26 +07:00
2026-09-13 22:55:26 +07:00
2026-09-12 21:48:08 +07:00
2026-09-13 08:02:22 +07:00
2026-09-13 17:40:59 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:06:40 +07:00
2026-09-13 08:11:57 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 16:22:58 +07:00
2026-09-12 20:34:32 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-13 17:55:00 +07:00
2026-09-13 13:07:25 +07:00
2026-09-13 15:27:31 +07:00
2026-09-11 19:39:29 +07:00
2026-09-13 19:43:18 +07:00
2026-09-13 10:35:20 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 11:36:01 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 09:11:34 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-13 14:49:11 +07:00
2026-09-12 23:06:40 +07:00
2026-09-13 12:44:02 +07:00
2026-09-12 11:15:58 +07:00
2026-09-13 15:23:37 +07:00
2026-09-13 14:49:11 +07:00
2026-09-13 14:49:11 +07:00
2026-09-13 15:23:37 +07:00
2026-09-13 08:07:44 +07:00
2026-09-13 14:49:11 +07:00
2026-09-13 09:32:58 +07:00
2026-09-12 22:00:13 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 20:59:12 +07:00
2026-09-12 20:59:12 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 20:59:12 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 16:09:27 +07:00
2026-09-12 16:34:25 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 04:46:41 +07:00
2026-09-12 16:46:30 +07:00
2026-09-12 16:46:30 +07:00
2026-09-12 16:46:30 +07:00
2026-09-11 20:11:01 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 17:54:36 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 15:40:08 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 10:40:47 +07:00
2026-09-12 05:32:25 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-12 05:32:25 +07:00
2026-09-13 07:59:04 +07:00
2026-09-13 20:33:47 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 23:06:40 +07:00
2026-09-13 07:50:03 +07:00
2026-09-12 23:06:40 +07:00
2026-09-13 07:50:03 +07:00
2026-09-12 16:09:48 +07:00
2026-09-13 14:49:11 +07:00
2026-09-13 09:32:58 +07:00
2026-09-13 09:17:47 +07:00
2026-09-13 14:37:55 +07:00
2026-09-12 05:32:25 +07:00
2026-09-12 05:32:25 +07:00
2026-09-12 05:32:25 +07:00
2026-09-12 10:51:14 +07:00
2026-09-12 05:32:25 +07:00
2026-09-12 14:47:54 +07:00
2026-09-13 18:00:35 +07:00
2026-09-13 18:00:35 +07:00
2026-09-12 05:32:25 +07:00
2026-09-12 10:40:47 +07:00
2026-09-12 05:32:25 +07:00
2026-09-13 17:40:59 +07:00
2026-09-13 14:49:11 +07:00
2026-09-12 11:38:24 +07:00
2026-09-12 11:38:24 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:06:40 +07:00
2026-09-13 14:49:11 +07:00
2026-09-12 20:27:19 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 11:15:58 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:12:49 +07:00
2026-09-12 11:12:49 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:12:49 +07:00
2026-09-12 11:12:49 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:41:24 +07:00