Bug 17158

Summary: matrix indexing broken for long matrix
Product: R Reporter: Michael Schubmehl <michael.schubmehl>
Component: Low-levelAssignee: R-core <R-core>
Status: CLOSED FIXED    
Severity: normal CC: maechler
Priority: P5    
Version: R-devel (trunk)   
Hardware: x86_64/x64/amd64 (64-bit)   
OS: Linux-RHEL   
Attachments: patch to subset.c

Description Michael Schubmehl 2016-09-23 19:07:05 UTC
Created attachment 2162 [details]
patch to subset.c

The following matrix indexing operation errors:

a = matrix(0,47000,47000)
a[1,1]
Error: long vectors not supported yet: subset.c:753

I believe this is due to the use of LENGTH instead of XLENGTH on that line and the following few lines. Attached is a patch that seems to resolve the issue. Thanks!
Comment 1 Martin Maechler 2016-10-10 19:58:04 UTC
Thank you!   Indeed, all is as you say.
I've confirmed the problem and that your patch fixes it.

I've committed it to R-devel  and will port it to R-patched ... which should become R 3.3.2 by the end of the month.