We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8761cb6 commit 7c2a11eCopy full SHA for 7c2a11e
src/core/t-date.c
@@ -746,6 +746,7 @@
746
747
if (type == REB_DATE) {
748
if (action == A_SUBTRACT) {
749
+ if(!IS_DATE(val)) Trap_Math_Args(REB_INTEGER, A_SUBTRACT);
750
num = Diff_Date(date, VAL_DATE(arg));
751
goto ret_int;
752
}
src/tests/units/date-test.r3
@@ -130,6 +130,10 @@ Rebol [
130
--assert error? try [load "3-Jan-2010/10:00+2:00:56"]
131
--assert error? try [load "3-Jan-2010/10:00+2:00:56.1234pm"]
132
133
+ --test-- "issue-276"
134
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/276
135
+ --assert error? try [0 - 1-jan-0000] ;- no crash!
136
+
137
===end-group===
138
139
===start-group=== "DATE/TIMEZONE"
0 commit comments