[comp.sys.transputer] Bug in extractor/loader utility of TDS

pak@tumuc.UUCP (Peter A. Krauss) (04/17/89)

Inmos gives us the source of the extractor loader in \tds2\tools\src
of the D700D TDS. The extractor loader performs the same function as
the TDS configurer utilities [EXTRACT] and [LOAD NETWORK].

But there is a bug, which prevents the correct extract function.
I'm talking about the Version 6b (18th February 1988).
Below is the corrected source (partial).

{{{  EXTLOAD.tsr
{{{  procedures
{{{  handle files
{{{  PROC read.code
PROC read.code (CHAN OF ANY from.uf, to.uf, []BYTE code.buffer, INT code.ptr)
  ...
  SEQ
    ...
    WHILE (tag <> fsd.endstream) AND (result = fi.ok) AND ok
      SEQ
        ...
        IF
          {{{  record
          tag = fsd.record
            SEQ
              IF
                (code.ptr + length) < (SIZE code.buffer)
                  SEQ  --                . <<<<<<<<<<<<<<<<<<<<- bug
                    -- [code.buffer FROM 0 FOR length] :=
                    [code.buffer FROM code.ptr FOR length] :=
                      [data.buffer FROM 0 FOR length]
                    code.ptr := code.ptr + length
                TRUE
                  value.error (code.ptr + length, ". Code buffer overflow")
          }}}
          ...
:
}}}
}}}
}}}
}}}

+----------------------------------------------------------+
| Peter A Krauss  (pak@tumuc.e-technik.tu-muenchen.dbp.de) |
+----------------------------------------------------------+