Fix underflow when UDP has 1 input.
This commit is contained in:
parent
46e868d313
commit
ae23a8f6bf
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: compile.cc,v 1.39 2001/04/24 02:23:59 steve Exp $"
|
#ident "$Id: compile.cc,v 1.40 2001/04/24 03:48:53 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "compile.h"
|
# include "compile.h"
|
||||||
|
|
@ -319,7 +319,7 @@ void compile_udp_functor(char*label, char*type,
|
||||||
struct vvp_udp_s *u = udp_find(type);
|
struct vvp_udp_s *u = udp_find(type);
|
||||||
assert (argc == u->nin);
|
assert (argc == u->nin);
|
||||||
|
|
||||||
int nfun = (argc-2) / 3 + 1;
|
int nfun = argc<=4 ? 1 : (argc-2) / 3 + 1;
|
||||||
|
|
||||||
vvp_ipoint_t fdx = functor_allocate(nfun);
|
vvp_ipoint_t fdx = functor_allocate(nfun);
|
||||||
functor_t obj = functor_index(fdx);
|
functor_t obj = functor_index(fdx);
|
||||||
|
|
@ -944,6 +944,9 @@ void compile_dump(FILE*fd)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: compile.cc,v $
|
* $Log: compile.cc,v $
|
||||||
|
* Revision 1.40 2001/04/24 03:48:53 steve
|
||||||
|
* Fix underflow when UDP has 1 input.
|
||||||
|
*
|
||||||
* Revision 1.39 2001/04/24 02:23:59 steve
|
* Revision 1.39 2001/04/24 02:23:59 steve
|
||||||
* Support for UDP devices in VVP (Stephen Boettcher)
|
* Support for UDP devices in VVP (Stephen Boettcher)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: udp.h,v 1.1 2001/04/24 02:23:59 steve Exp $"
|
#ident "$Id: udp.h,v 1.2 2001/04/24 03:48:53 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "pointers.h"
|
#include "pointers.h"
|
||||||
|
|
@ -109,6 +109,9 @@ inline vvp_ipoint_t udp_idx_t::next_node()
|
||||||
|
|
||||||
inline vvp_ipoint_t udp_idx_t::parent()
|
inline vvp_ipoint_t udp_idx_t::parent()
|
||||||
{
|
{
|
||||||
|
if (nin<=4)
|
||||||
|
return 0x0;
|
||||||
|
|
||||||
int idx = (cur_i==nin-1 ? cur_i-1 : cur_i) / 3;
|
int idx = (cur_i==nin-1 ? cur_i-1 : cur_i) / 3;
|
||||||
if (!idx)
|
if (!idx)
|
||||||
return 0x0;
|
return 0x0;
|
||||||
|
|
@ -117,6 +120,9 @@ inline vvp_ipoint_t udp_idx_t::parent()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: udp.h,v $
|
* $Log: udp.h,v $
|
||||||
|
* Revision 1.2 2001/04/24 03:48:53 steve
|
||||||
|
* Fix underflow when UDP has 1 input.
|
||||||
|
*
|
||||||
* Revision 1.1 2001/04/24 02:23:59 steve
|
* Revision 1.1 2001/04/24 02:23:59 steve
|
||||||
* Support for UDP devices in VVP (Stephen Boettcher)
|
* Support for UDP devices in VVP (Stephen Boettcher)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue