[Rd] PATCH: fix for bug 7924
Kevin B. Hendricks
kevin.hendricks at sympatico.ca
Wed Jun 7 17:58:15 CEST 2006
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
More information about the R-devel
mailing list