Il 10/07/2012 16:26, Gwenaël Casaccio ha scritto:
>>
> Here is the new iteration, there is one issue with the bytecode checker:
> jump skips extension bytecode
> If I comment self checkTagIfInPath: tag. it works

Fixed like this:

diff --git a/libgst/opt.c b/libgst/opt.c
index ef75763..d37780f 100644
--- a/libgst/opt.c
+++ b/libgst/opt.c
@@ -412,11 +412,16 @@ search_block (const PTR a, const PTR b)
 int
 compute_jump_length (int ofs)
 {
-  if (ofs > -256 && ofs < 256)
+  /* The offset is counted from the end of the bytecode and the result of
+     compute_jump_length is subtracted when computing the jump offset (the
+     the jump offset increases in absolute value when jumping back).  This
+     means the actual range for backwards jumps is a little less than 2^8k
+     bytes, while for forwards jumps it is a little more than 2^8k bytes.  */
+  if (ofs > -254 && ofs < 258)
     return 2;
-  else if (ofs > -65536 && ofs < 65536)
+  else if (ofs > -65532 && ofs < 65540)
     return 4;
-  else if (ofs > -16777216 && ofs < 16777216)
+  else if (ofs > -16777210 && ofs < 16777222)
     return 6;
   else
     return 8;

The parsing of the attributes is a bit fragile, I'll rewrite that and commit
the patch.  Thanks!

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to