Skip to content

Commit d1c1e80

Browse files
committed
FIX: Crash when converting empty vector to block
fixes: metaeducation/rebol-issues#2346
1 parent 8c18f89 commit d1c1e80

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/core/t-vector.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ void Set_Vector_Row(REBSER *ser, REBVAL *blk)
211211
VAL_SET(val, (type >= VTSF08) ? REB_DECIMAL : REB_INTEGER);
212212
VAL_INT64(val) = get_vect(type, data, n); // can be int or decimal
213213
}
214+
SET_END(val);
214215
}
215216

216-
SET_END(val);
217217
ser->tail = len;
218218

219219
return ser;

src/tests/units/series-test.r3

+7
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,11 @@ Rebol [
166166
===end-group===
167167

168168

169+
===start-group=== "VECTOR"
170+
171+
--test-- "issue/2346"
172+
--assert [] = to-block make vector! 0
173+
174+
===end-group===
175+
169176
~~~end-file~~~

0 commit comments

Comments
 (0)