Skip to content

Commit

Permalink
FIX: SAME? on VECTORs return TRUE even when vectors are not identical
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 5, 2020
1 parent 35815ce commit 62af92f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/t-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ void Set_Vector_Row(REBSER *ser, REBVAL *blk)
/*
***********************************************************************/
{
if (mode == 3)
return VAL_SERIES(a) == VAL_SERIES(b) && VAL_INDEX(a) == VAL_INDEX(b);

REBINT n = Compare_Vector(a, b); // needs to be expanded for equality
if (mode >= 0) {
return n == 0;
Expand Down
12 changes: 12 additions & 0 deletions src/tests/units/vector-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,18 @@ Rebol [

===start-group=== "VECTOR copy"

--test-- "COPY"
;@@ https://github.com/rebol/rebol-issues/issues/2400
v1: #[ui16! [1 2]]
v2: v1
v3: copy v2
--assert same? v1 v2
--assert not same? v1 v3
v2/1: 3
--assert v1/1 = 3
--assert v3/1 = 1


--test-- "COPY/PART"
;@@ https://github.com/rebol/rebol-issues/issues/2399
v: #[ui16! [1 2 3 4]]
Expand Down

0 comments on commit 62af92f

Please sign in to comment.