-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.Status: Won't FixThis issue would not be worked on.This issue would not be worked on.
Description
The official language website claims that V has "no undefined behavior". However, division by zero is undefined with C as backend. I think this makes division by zero undefined as well.
Also, overflow/underflow is undefined as well.
OS: linux, "Arch Linux"
CC version: cc (GCC) 11.1.0
V full version: V 0.2.2 69f31d8
What did you do?
Run the following program with v run test.v
fn main() {
a := 0
println(1 / a)
}
What did you expect to see?
Make x / 0 a defined value, e.g. 0, and allow or block after it.
Or, like in Pony, add operators like /? that propagates the error.
What did you see instead?
Runtime error in debug mode.
SIGILL in release mode.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugThis tag is applied to issues which reports bugs.This tag is applied to issues which reports bugs.Status: Won't FixThis issue would not be worked on.This issue would not be worked on.