Potential g-wrap bug?

Rob Browning rlb@defaultvalue.org
Mon, 10 Jun 2002 14:33:04 -0500


Derek Atkins <warlord@MIT.EDU> writes:

> With help from Bill Gribble I tracked down part of this problem.  If
> I pass "#f" into a function expecting a gw:glist-of, it still produces
> a segfault.  If I pass "'()" (an empty list) it works properly and does
> not seg fault.

Yeah.  I don't think I originally expected people to use ().  I hadn't
really thought about passing in #f, but I could see it either of the
following ways:

  (1) Allowing #f is less appropriate (and certainly less schemey)
      than requiring (), so we shouldn't.

  (2) People already use #f all over the place for NULL on the scheme
      side, so it's natural to expect #f to work here for what
      (underneath) is really a GList*.

I lean toward (1), though it should probably be fixed to not segfault.

Right now it traverses the input list building the output list, but
destroys the accumulated output list if anything goes wrong.  I think
the "goes wrong" checking just needs a little fixing.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD