View | Details | Raw Unified | Return to bug 17158
Collapse All | Expand All

(-)src/main/subset.c (-5 / +5 lines)
Lines 750-772 Link Here
750
		    R_xlen_t k = i - 1 + nrow * (j - 1);
750
		    R_xlen_t k = i - 1 + nrow * (j - 1);
751
		    switch (TYPEOF(x)) {
751
		    switch (TYPEOF(x)) {
752
		    case REALSXP:
752
		    case REALSXP:
753
			if (k < LENGTH(x))
753
			if (k < XLENGTH(x))
754
			    return ScalarReal( REAL(x)[k] );
754
			    return ScalarReal( REAL(x)[k] );
755
			break;
755
			break;
756
		    case INTSXP:
756
		    case INTSXP:
757
			if (k < LENGTH(x))
757
			if (k < XLENGTH(x))
758
			    return ScalarInteger( INTEGER(x)[k] );
758
			    return ScalarInteger( INTEGER(x)[k] );
759
			break;
759
			break;
760
		    case LGLSXP:
760
		    case LGLSXP:
761
			if (k < LENGTH(x))
761
			if (k < XLENGTH(x))
762
			    return ScalarLogical( LOGICAL(x)[k] );
762
			    return ScalarLogical( LOGICAL(x)[k] );
763
			break;
763
			break;
764
		    case CPLXSXP:
764
		    case CPLXSXP:
765
			if (k < LENGTH(x))
765
			if (k < XLENGTH(x))
766
			    return ScalarComplex( COMPLEX(x)[k] );
766
			    return ScalarComplex( COMPLEX(x)[k] );
767
			break;
767
			break;
768
		    case RAWSXP:
768
		    case RAWSXP:
769
			if (k < LENGTH(x))
769
			if (k < XLENGTH(x))
770
			    return ScalarRaw( RAW(x)[k] );
770
			    return ScalarRaw( RAW(x)[k] );
771
			break;
771
			break;
772
		    default: break;
772
		    default: break;

Return to bug 17158