From kevin.hendricks at sympatico.ca  Wed Jun  7 17:58:15 2006
From: kevin.hendricks at sympatico.ca (Kevin B. Hendricks)
Date: Wed, 7 Jun 2006 11:58:15 -0400
Subject: [Rd] PATCH: fix for bug 7924
In-Reply-To: <Pine.LNX.4.64.0606050729190.6381@homer21.u.washington.edu>
References: <9448B15C-0CCA-4E4C-A355-60C80066FF0D@sympatico.ca>
	<44840325.6020201@cimr.cam.ac.uk>
	<Pine.LNX.4.64.0606050729190.6381@homer21.u.washington.edu>
Message-ID: <A44D8E26-C414-4C96-ADC2-9C8F19B29A09@sympatico.ca>

Hi,

Since no one answered my questions about the "theoretically correct  
values of named for that LANGSXP object, I made an assumption that  
the problem was in the creation of the call2 object to begin with.

Yes, the bug was there.

Inline is the patch to fix bug 7924.

It seems that in subset.c in do_subset_dflt, if the final object is a  
LANGSXP object we allocate a new object and copy from the just  
allocated result VECSXP object to a list style object (to make it a  
LANGSXP object) but we forgot to copy over the NAMED value as well so  
we were leaving it basically blank and ignoring all of the logic in  
ExtractSubset and VectorSubset that actually determined the proper  
named value in the first place.

Here is the patch.  With this patch in place, the test case passes.

Hopefully we can now close bug 7924

[kbhend at base3 R]$ cat bug_7924_fix.patch
--- src/main/subset.c.keep      2006-06-07 09:58:26.000000000 -0400
+++ src/main/subset.c   2006-06-07 11:49:40.000000000 -0400
@@ -675,6 +675,7 @@
         setAttrib(ans, R_DimSymbol, getAttrib(ax, R_DimSymbol));
         setAttrib(ans, R_DimNamesSymbol, getAttrib(ax,  
R_DimNamesSymbol));
         setAttrib(ans, R_NamesSymbol, getAttrib(ax, R_NamesSymbol));
+       SET_NAMED(ans,NAMED(ax));
      }
      else {
         PROTECT(ans);




Kevin



[Rd] PATCH: fix for bug 7924
Kevin B. Hendricks