<div dir="auto">It's a limitation of bytecodes. There are possible workarounds, like splitting the jump in several pieces... Very technical, and will fool the decompiler and the debugger. If closures bytecodes are stored separately then it's also possible to un-optimize the block (do not inline but just use a message send).</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 29 janv. 2021 à 13:33, Nicolás Papagna Maldonado via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Aloha folks,<div><br></div><div>I was making some changes to Code Coverage and ran into this compiler error while I was trying to re-compile a method with code coverage tracing added to it.</div><div>In short, Code Coverage wraps each message send in a block and calls a special selector on it that evaluates it and register code coverage information of the wrapped collaborations.</div><div><br></div><div>I've found that for some methods the "genJumpLong: distance index is out of range" and I quite don't understand why.</div><div>In this case "emitCodeForWhile: stack encoder: encoder value: forValue" is called, which in turn calls "emitCodeForJump: dist encoder: encoder", which ends up raising the error a couple stack frames later.</div><div><br></div><div>As far as I understand, it looks like "the body of the while loop was long enough to make the compiler unable to generate the jump". But that's all I got :)</div><div><br></div><div>Do you have any pointers about how to avoid this altogether?</div><div>It's kind of a blocker to me, as there are some methods that cannot be analyzed by Code Coverage right now.</div><div><br></div><div>Thanks in advance!</div><div>Nico PM</div><div><br></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>