From maechler at stat.math.ethz.ch  Fri May  7 11:22:52 2004
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Fri May  7 11:22:58 2004
Subject: [Rd] segfault in approx() (PR#6809)
Message-ID: <20040507092252.63C53F0E7@slim.kubism.ku.dk>

>>>>> "PD" == Peter Dalgaard <p.dalgaard@biostat.ku.dk>
>>>>>     on 22 Apr 2004 00:11:00 +0200 writes:

    PD> kjetil@entelnet.bo writes:
    >> This is R1.9.0, windows XP
    >> 
    >> I run across the following:
    >> 
    >> It is admittedly silly, but it shouldn't segfault:
    >> 
    >> test <- list(y=1:100, x=rep(NaN, 100))
    >> approx(test, xout=rep(NaN, 10))
    >> 
    >> Bombs!

    PD> Yup. Sanity check needed on entrance to approx1. I suppose that

    PD> if (!n) return NaN;
	   
    PD> should do the trick.

indeed!  s/NaN/R_NaN/ 
Will commit for R-patched {future 1.9.1}.

Martin


[Rd] segfault in approx() (PR#6809)
maechler@stat.math.ethz.ch