-
-
Notifications
You must be signed in to change notification settings - Fork 312
Closed
Labels
BugSomething isn't workingSomething isn't workingFixed needs testingNeeds verification / testing that it now worksNeeds verification / testing that it now works
Milestone
Description
The program panics when dividing a float by a variable set to 0 (safe mode enabled). This does not occur when dividing by float literals or constants.
Source:
fn void ok() {
1f / 0f; // = inf
}
fn void panic() {
float x = 0f;
1f / x; // panic
}
fn void main() {
ok();
panic();
}
Output:
ERROR: 'Division by zero.'
in std.core.builtin.default_panic (/home/dom/c3test/c3/lib/std/core/builtin.c3:175) [./main]
in main.main (/home/dom/c3test/main.c3:7) [./main]
in @main_to_void_main (/home/dom/c3test/c3/lib/std/core/private/main_stub.c3:18) [./main] [inline]
in main (/home/dom/c3test/main.c3:5) [./main]
in __libc_init_first (source unavailable) [/usr/lib/libc.so.6]
in __libc_start_main (source unavailable) [/usr/lib/libc.so.6]
in _start (source unavailable) [./main]
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingFixed needs testingNeeds verification / testing that it now worksNeeds verification / testing that it now works