<div dir="auto"><div class="gmail_quote gmail_quote_container" dir="auto"><div dir="ltr" class="gmail_attr">Sven Barth <<a href="mailto:pascaldragon@googlemail.com">pascaldragon@googlemail.com</a>> schrieb am Mo., 20. Okt. 2025, 22:14:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
  
  <div>
    <div>Am 18.10.2025 um 22:39 schrieb Bart via
      fpc-devel:<br>
    </div>
    <blockquote type="cite">
      <pre>On Fri, Oct 17, 2025 at 9:33 PM Sven Barth via fpc-devel
<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer"><fpc-devel@lists.freepascal.org></a> wrote:

</pre>
      <blockquote type="cite">
        <pre>David's problem is *not* due to a corruction or a bug, but due to an
optimization that FPC performs that leads to different behavior, namely
changing virtual methods that are empty to EmptyMethod to reduce the
number of duplicate (empty) methods in the binary.
</pre>
      </blockquote>
      <pre>Does that mena that such a check is in essence invalid?
IIRC then we have such a check in TCustomEdit in LCL....</pre>
    </blockquote>
    <span style="white-space:pre-wrap">
Well, the language does neither explicitly forbid nor allow it...

So you'd have to do a more complete check that includes both the real base method as well as System.EmptyMethod. Maybe best move the general check to a separate function which gets passed both method pointers and then compares those as well as the base one against EmptyMethod.<br></span></div></blockquote></div><div dir="auto"><br></div><div dir="auto">Sleeping about this a bit I think the solution needs to if either of two methods is redirected to EmptyMethod then the code must assume that the method was overridden, cause that's the only save assumption it can do (and afterall code should handle that gracefully even if it might be less optimal from the developer's point of view). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote gmail_quote_container" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><span style="white-space:pre-wrap"></span></div>

</blockquote></div></div>