[fpc-devel] Cleanup of the r7012 for the Go32v2
XHajT03 at mbox.vol.cz
Sun Jul 1 20:20:49 CEST 2007
On 1 Jul 07, at 10:27, borsa77 at libero.it wrote:
> On 30 Jun 2007 at 22:28, Tomas Hajny wrote:
> > The reason for the first change isn't clear to me
> > (what is being fixed or improved by this change) -
> > I recommend to provide clarifications why a
> > change is needed when sending patches.
> The problem fixed by r7012 is that the variable argv0len is incremented
> before the placement of the null character in the string cmdline so it is
> resulted in a out of range by one. The original fix solves it with an auxiliary
> variable that is not strictly necessary, when you can adjust the index.
First, I don't see why using the helper variable
should be worse than the newly proposed version.
Actually, I even believe that the optimizer might
be able to get rid of it if not needed (i.e. if
more efficient - on the other hand, using the
helper variable may be better because the
addition of length(doscmd) to argv0len is
performed only once rather than twice).
Second, as far as I can see, the proposed code
isn't semantically identical to the original one
(the terminating #0 is placed 1 byte earlier). So
unless there's a reason to change it (that's what
I asked about in the previous e-mail), I wouldn't
touch it. If you think that it needs to be
changed, please, provide clarification why it's
so and why the current version is wrong.
> PS: I sent the second part of the correction to the graph unit, I don't know if
> you are absent, in case please see at Graph unit under Go32v2 of the 12
> Jun 2007.
I was indeed on holiday at that time. However, I
can't test GO32v2 patches properly anyway at the
moment, so I decided not to apply them any longer
unless they are really obvious and I can reliably
foresee their effects. I'm sorry about that -
maybe someone else (like Pierre) can check and
apply them if appropriate.
More information about the fpc-devel