diff --git a/CHANGELOG.md b/CHANGELOG.md index 5edbc1a1..e11f2145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## Next Release - TBD + +Features + +- Added SRFI 143 - Fixnums. + +Bug Fixes + +- Prevent `remainder` from crashing the runtime due to divide by zero. + ## 0.5.4 - August 3, 2017 Features diff --git a/runtime.c b/runtime.c index 1513deda..1bfc5b25 100644 --- a/runtime.c +++ b/runtime.c @@ -3367,6 +3367,7 @@ void Cyc_remainder(void *data, object cont, object num1, object num2) j = ((double_type *)num2)->value; } } + if (j == 0) { Cyc_rt_raise_msg(data, "Divide by zero"); } result = obj_int2obj(i % j); return_closcall1(data, cont, result); }