[Top][All Lists]

 From: Martin Dvh Subject: Re: [Discuss-gnuradio] Bug in gnuradio-core\src\lib\general\gr_test.cc Date: Tue, 26 Feb 2008 23:44:24 +0100 User-agent: Icedove 1.5.0.14pre (X11/20071018)

```Andrew Rose wrote:
> I've got a background project to try to get GNU Radio working with the
> native Windows tool chain (see
> side-effect of using a different compiler, I get different
> warnings/errors.
>
> Here's something I found that's almost certainly wrong.  From svn trunk,
>
>      //Now copy input to output untill max ninputs or max noutputs is
> reached
>      int common_nports=std::min(ninputs,noutputs);
>      if(d_sizeof_output_item==d_sizeof_input_item);
>        for (int i = 0; i < common_nports; i++)
>        {
>
> memcpy(output_items[i],input_items[i],noutput_items*d_sizeof_input_item)
> ;
>        }
>      int noutput_items_produced=0;
>
> The fix appears to be trivial (remove the semicolon at the end of the
> if(...) line).  However, I don't want to make the fix myself because I
> can't test it (because I'm still a long way off having a working build).
> I don't know if it would break any existing QAs.

Yes this was very wrong and could result in segfaults when
d_sizeof_output_item!=d_sizeof_input_item.
I committed the fix.

> I thought I'd flag it up in case it might be causing anybody any
> problems.  (If you fix it, why not change, untill -> until in the
> comment too.)
>
> Andrew

Thanks, fixed that too ;-)

Greetings,
Martin

>
>
> _______________________________________________