[Rd] R 1.3.0 bug: after "y _ 10; x[[1]] _ y", assigning to "y[1]" modifies "x" (PR#1043)

Luke Tierney luke@nokomis.stat.umn.edu
Tue, 7 Aug 2001 19:08:00 -0500


On Tue, Aug 07, 2001 at 10:54:53PM +0200, Peter Dalgaard BSA wrote:
> buhr@stat.wisc.edu writes:
> 
> Confirmed with 1.3.0-patched on RedHat 7.1. For easier reproduction:
> 
> x <- list()
> y <- 10
> x[[1]] <- y
> x
> y[1] <- 20   # should only modify "y"
> # y <- 20 # Works OK with this instead
> x
>  

Should be fixed.  The particular branch in
subassign.c:SubassignTypeFix did not duplicate the RHS when it is
NAMED--I added that on R-1-3-patches.

I've looked briefly at the subassign code before and had the nagging
feeling that there may be several places where this sort of change is
needed but I haven't had the stomach to look carefully.

luke

-- 
Luke Tierney
University of Minnesota                      Phone:           612-625-7843
School of Statistics                         Fax:             612-624-8868
313 Ford Hall, 224 Church St. S.E.           email:      luke@stat.umn.edu
Minneapolis, MN 55455 USA                    WWW:  http://www.stat.umn.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._