Skip to content

segfault in approx() (PR#6809)

2 messages · Kjetil Halvorsen, Peter Dalgaard

#
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!

Kjetil Halvorsen
#
kjetil@entelnet.bo writes:
Yup. Sanity check needed on entrance to approx1. I suppose that

  if (!n) return NaN;

should do the trick.