guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in array-equal?


From: Roland Orre
Subject: bug in array-equal?
Date: Wed, 29 Sep 2004 13:09:19 +0200

Case label scm_tc7_svect was missing in switch statement in
ramap.c (this is guile 1.7) causing stack overflow for e.g.
(array-equal? #h(1 2 3) #h(1 2 3))

        Best regards
        Roland



SCM
scm_array_equal_p (SCM ra0, SCM ra1)
{
  if (SCM_IMP (ra0) || SCM_IMP (ra1))
    callequal:return scm_equal_p (ra0, ra1);
  switch (SCM_TYP7(ra0))
    {
    default:
      goto callequal;
    case scm_tc7_bvect:
    case scm_tc7_string:
    case scm_tc7_byvect:
    case scm_tc7_uvect:
    case scm_tc7_ivect:
    case scm_tc7_svect:
    case scm_tc7_fvect:
    case scm_tc7_dvect:
    case scm_tc7_cvect:
    case scm_tc7_vector:
    case scm_tc7_wvect:
      break;
    case scm_tc7_smob:
      if (!SCM_ARRAYP (ra0))
        goto callequal;
    }
  switch (SCM_TYP7 (ra1))
    {
    default:
      goto callequal;
    case scm_tc7_bvect:
    case scm_tc7_string:
    case scm_tc7_byvect:
    case scm_tc7_uvect:
    case scm_tc7_ivect:
    case scm_tc7_svect:
    case scm_tc7_fvect:
    case scm_tc7_dvect:
    case scm_tc7_cvect:
    case scm_tc7_vector:
    case scm_tc7_wvect:
      break;
    case scm_tc7_smob:
      if (!SCM_ARRAYP (ra1))
        goto callequal;
    }
  return SCM_BOOL(raeql (ra0, SCM_BOOL_F, ra1));
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]