Closed alufers closed 2 months ago
Awesome, thanks. I never realized that 1%0
causes a crash of the embedded system.
Additionally I have moved the actual float modulo and division into the
else
branch of the check, to prevent UB even when the division by zero was caught.
This is not strictly necessary but does not harm indeed. vm_error(vm, "divzero_error", "division by zero");
never returns.
Makes the behavior consistent with division ('/' operator), prevents full VM crash. Similar behavior is observed in Python (v. 3.11.8).
Additionally I have moved the actual float modulo and division into the
else
branch of the check, to prevent UB even when the division by zero was caught.Added testcase to check this behavior.