Euphoria
Ticket #639:
Add_internal_space mishandles the s1_ptr->base pointer
-
Reported by
mattlewis
Mar 28, 2011
In the runtime, function Add_internal_space() assumes that the base pointer will always be set the way a sequence is created. However, a RHS_slice in place can move the base pointer as an optimization. The following code fails:
sequence a, b
a = "abc" & "d"
a = a[2..$]
b = "123"
a = splice( a, b, 2 )
test_equal("in place RHS_slice + in place splice()", "b123cd", a )
Details
1. Comment by mattlewis
Mar 28, 2011
See: hg:euphoria/rev/b1d985dd4651
changeset: 4762:b1d985dd4651 branch: 4.0 user: Matt Lewis date: Mon Mar 28 06:28:36 2011 -0400 files: tests/t_sequence.e description:
- unit test to demonstrate ticket 639
2. Comment by mattlewis
Mar 28, 2011
See: hg:euphoria/rev/2d0869bf8e16
changeset: 4763:2d0869bf8e16 branch: 4.0 tag: tip user: Matt Lewis date: Mon Mar 28 06:57:16 2011 -0400 files: docs/release/4.0.1.txt source/be_runtime.c description:
- fix inplace RHS slice, in place splice on sequence with refcount 1
- fixes ticket 639