help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] Package patch


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Package patch
Date: Sun, 15 Jul 2012 15:01:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

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




reply via email to

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