<div dir="ltr">On Sat, Apr 16, 2016 at 5:42 PM, Jonas Maebe <span dir="ltr"><<a href="mailto:jonas.maebe@elis.ugent.be" target="_blank">jonas.maebe@elis.ugent.be</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><span class=""><div><br></div><div>Yes, a test program that can be used to reproduce the bug (preferably command line)<br></div></span><span class=""><br></span></div></blockquote><div>even better! it's pure OSX (x86_64)! not need for iOS </div><div><a href="http://bugs.freepascal.org/view.php?id=30022">http://bugs.freepascal.org/view.php?id=30022</a><br></div><div><br></div><div>The sample is using block-based APIs of NSFileHandle</div><div><a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/">https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/</a></div><div><br></div><div>to be honest. I've no idea how the method should work, but I'd expect it shouldn't throw an access violation.</div><div><br></div><div>It feels like the problem arrises when the run time tries to copy the block. The sample with NSArrays traversing doesn't try to retain the block, instead it just calls it right away.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>Yes, that's what optional field means (as opposed to field that is optionally initialised or so). You can check the clang source code too: <a href="http://llvm.org/svn/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp" target="_blank">http://llvm.org/svn/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp</a></div></div></blockquote><div>Got it! </div><div><br></div><div>thanks,</div><div>Dmitry</div></div></div></div>