Displaying 3 results from an estimated 3 matches for "clear_vector_elt".
2024 Apr 05
1
Bug in out-of-bounds assignment of list object to expression() vector
...nment.
The bug relies on `x` not being IS_GROWABLE(), which may explain 
why a plain x[[4]] <- list() sometimes doesn't fail.
The future assignment result `x` is now expression(a, b, c, NULL), and
the old `x` set to expression(NULL, NULL, NULL) by SET_VECTOR_ELT(newx,
i, VECTOR_ELT(x, i)); CLEAR_VECTOR_ELT(x, i); during EnlargeVector().
4. But then the assignment fails, raising the error back in
do_subassign2_dflt(), because the assignment kind is invalid: there is
no way to put data.frames into an expression vector. The new resized
`x` is lost, and the old overwritten `x` stays there.
Not sure wha...
2024 Apr 05
1
[External] Re: Bug in out-of-bounds assignment of list object to expression() vector
...on `x` not being IS_GROWABLE(), which may explain
> why a plain x[[4]] <- list() sometimes doesn't fail.
>
> The future assignment result `x` is now expression(a, b, c, NULL), and
> the old `x` set to expression(NULL, NULL, NULL) by SET_VECTOR_ELT(newx,
> i, VECTOR_ELT(x, i)); CLEAR_VECTOR_ELT(x, i); during EnlargeVector().
>
> 4. But then the assignment fails, raising the error back in
> do_subassign2_dflt(), because the assignment kind is invalid: there is
> no way to put data.frames into an expression vector. The new resized
> `x` is lost, and the old overwritten `x` st...
2024 Apr 05
3
Bug in out-of-bounds assignment of list object to expression() vector
There seems to be a bug in out-of-bounds assignment of list objects to an
expression() vector. Tested on release and devel. (Many thanks to folks
over at Mastodon for the help narrowing down this bug)
When assigning a list into an existing index, it correctly errors on
incompatible type, and the expression vector is unchanged:
```
x <- expression(a,b,c)
x[[3]] <- list() # Error
x
#>