Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue C63005     [previous patch]

Backpatch errors in large V8 games
Submitted by: Cedric Knight     Appeared in: Compiler 6.15 or before     Fixed in: Compiler 6.31
Problem

If the code size of a V8 game exceeds 256K, backpatching and other strange errors occur. This is a rare occurrence, since strings usually take more space than code, but is made more likely when using Infix debugging.

Solution

Backpatch information is stored in 3-byte records when compiling to Z-code, with the address to be patched in bytes 1 and 2, and bits 5-6 of byte 0. This should be fixed by converting to a 4-byte format.

Workaround

In section (2) of output_file_z()

  +++ files.c Wed Mar 24 18:01:54 2004
  @@ -326,6 +326,10 @@
           if (backpatch_marker >= 0x80) long_flag = FALSE;
           backpatch_marker &= 0x7f;
           offset = offset + (backpatch_marker/32)*0x10000;
  +        while (offset+0x30000 < j) {
  +            offset += 0x40000;
  +            long_flag = !long_flag;
  +        }
           backpatch_marker &= 0x1f;

           while (j<offset)


Last updated 17 April 2013. This web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Roger Firth.