lout-users
[Top][All Lists]
Advanced

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

Re: Problem using llx/urx in PS_LinkDest


From: Jeff Kingston
Subject: Re: Problem using llx/urx in PS_LinkDest
Date: Thu, 08 May 2008 07:59:02 +1100

You seem to be saying that there are no bugs in the canonical
distribution, but that there is a bug in the version with your
patch, and that the bug is a failure to initialize save_mark(x)
in objects of type LINK_DEST.

However, around line 686 of z23.c I can see this:

    case LINK_SOURCE:
    case LINK_DEST:
    case LINK_DEST_NULL:
    case LINK_URL:
    
      CountChild(y, LastDown(x), count);
      if( dim == COLM )
        save_mark(x) = xmk;
      else
      {
        ...
      }
      ...
      break;

Since the Lout memory allocator does not zero memory, save_mark(x)
will be uninitialized up to this point, and it is not a memory
allocator bug for it to contain an old pointer value before the
third line of the case above is executed.  The issue is, why has

      save_mark(x) = xmk

not been executed by the time your code is reached?  This code
should be executed twice, first with dim == COLM to work out
horizontal placement (which then gets saved in save_mark(x)
in these kinds of objects), then again with dim == ROWM to
work out vertical placement and do the actual printing.

Initializing save_mark(x) to zero, either within the memory
allocator or elsewhere, will merely mask out a deeper problem
of failure to execute this line of code.  Although xmk is often
zero it is not always zero by any means.

Jeff


reply via email to

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