Skip to content

Commit

Permalink
FIX: correct fix of regression when creating 64 bit vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 16, 2024
1 parent 238ecbc commit 6956360
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/t-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void Set_Vector_Row(REBSER *ser, REBVAL *blk)
ser->tail = len; // !!! another way to do it?

// Store info about the vector (could be moved to flags if necessary):
ser->size = (dims << 8) | (type << 3) | (sign << 2) | (bits >> 4)-1; // bits are zero based value!
ser->size = (dims << 8) | (type << 3) | (sign << 2) | (bits == 64 ? 3 : bits >> 4); // there are only 2 bits to store the info

return ser;
}
Expand Down
1 change: 1 addition & 0 deletions src/tests/units/vector-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Rebol [
--assert [1 2] = to block! #[u16! [1 2]]

--test-- "to-binary vector!"
;@@ https://github.com/Oldes/Rebol-issues/issues/2590
--assert #{01000200} = to binary! #[u16! [1 2]]
--assert #{0100000002000000} = to binary! #[i32! [1 2]]
--assert #{0000803F00000040} = to binary! #[f32! [1 2]]
Expand Down

0 comments on commit 6956360

Please sign in to comment.