[Rd] Latent flaw in SEXPREC definition

From: Radford Neal <radford_at_cs.toronto.edu>
Date: Sat, 13 Aug 2011 16:56:43 -0400

There seems to be a latent flaw in the definition of struct SEXPREC in Rinternals.h, which likely doesn't cause problems now, but could if the relative sizes of data types changes.

The SEXPREC structure contains a union that includes a primsxp, symsxp, etc, but not a vecsxp. However, in allocVector in memory.c, zero-length vectors are allocated using allocSExpNonCons, which appears to allocates a SEXPREC structure. This won't work if a vecsxp is larger than the other types that are in the union in the SEXPREC structure.

Simply adding a vecsxp to the union would seem to fix this, as in the following patch:

Index: src/include/Rinternals.h

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 13 Aug 2011 - 20:59:35 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 14 Aug 2011 - 02:00:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive