[fpc-devel] Competing patches
Christo Crause
christo.crause at gmail.com
Mon Apr 22 07:10:12 CEST 2019
On Sun, 21 Apr 2019, 04:50 J. Gareth Moreton, <gareth at moreton-family.com>
wrote:
> Hi everyone,
>
> Recently I decided to take up issue #34772 because, of all things, I was
> offered a bounty to fix it! I successfully fixed the bug, but another
> developer, seeing that I had assigned the issue to mysef, posted their own
> patch which is very different to what I did, but succeeds in what it was
> advertised to do. The two patches can't really be applied together (at
> least I think I can't), and I want to know what the policy is when it comes
> to two different solutions on offer.
>
> The developer, Sergei Gorelkin, gave me his patch to help save me some
> work, but was fine as it was, so I was surprised he didn't upload it
> earlier, given that this issue has been known since last December.
> Granted, I had already fixed the bug but had not let uploaded it due to
> double-checking things with the bounty and then because of the server
> maintenance.
>
> Not to blow my own trumpet, but I want to say my patch is slightly better
> because it's clearer as to what the code is doing to mitigate the issue,
> and in one particular case (an implicit finally block by itself), the
> compiler produces slightly more efficient code with "Exit" - Sergei's patch
> puts the jump destination before a "nop" instruction, while my code (and
> the trunk) places it after said "nop".
>
> Still, either way, the patch fixes the problem. I also wrote an extensive
> test, "tw34772.pp" that checks all different kinds of procedures with
> implicit finally blocks, safecall and explicit finally and except blocks to
> see if everything is fixed, along with overridden GetMem and FreeMem
> routines that track how many times they are called (increments for each
> GetMem and similar calls, decrements for each FreeMem call, so a pass is
> given if ReferenceCount = 0).
>
> Gareth
>
I could not identify a question, so I assume you are asking for advice?
Perhaps consider the following points:
* Explain the situation to the bounty sponsor.
* Acknowledge that there are two potential solutions.
* Based on change log history Jonas is one of the authorities in this area,
ask him for an opinion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190422/a6df0efe/attachment.html>
More information about the fpc-devel
mailing list