From p.dalgaard at biostat.ku.dk  Thu Apr 22 00:11:00 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Thu Apr 22 00:14:31 2004
Subject: [Rd] segfault in approx() (PR#6809)
In-Reply-To: <20040421215111.A2149104C2@slim.kubism.ku.dk>
References: <20040421215111.A2149104C2@slim.kubism.ku.dk>
Message-ID: <x2ad159e2z.fsf@biostat.ku.dk>

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!

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

  if (!n) return NaN;

should do the trick.


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] segfault in approx() (PR#6809)
Peter Dalgaard