<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><font face="Calibri">Calling NIL on NT/x86 is very well defined.</font></div><div><font face="Calibri">It is the same as reading/writing NIL.</font></div><div><font face="Calibri">You get a "structured exception" that you can catch using __try/__except.</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"> > Why does it not work to use exception on NIL call for that target?</font></div><div><font face="Calibri"> </font></div><div><font face="Calibri"> </font></div><div><font face="Calibri"> Who says it doesn't? Our current implementation suggests it doesn't,</font></div><div><font face="Calibri"> but that doesn't mean anything. Current implementation is often backwards.</font></div><div><font face="Calibri"> </font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">Maybe we install signal handlers on other platforms, but we don't put in the </font></div><div><font face="Calibri">equivalant high-level __try/__except on NT/x86.</font></div><div><font face="Calibri">Maybe we should provide a "ThreadBase" in C.</font></div><div><font face="Calibri"> </font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">But it's not like the process just jumps off into the weeds and does random stuff.</font></div><div><font face="Calibri">Debuggers break right and show a callstack. Without all that extra Modula-3 runtime stuff...</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"> - Jay</font></div><br><br><div style="font-family: Calibri; font-size: 12pt; "><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Subject: Re: [M3devel] -check_procs?<br>From: hosking@cs.purdue.edu<br>Date: Fri, 14 Sep 2012 11:05:37 -0400<br>CC: m3devel@elegosoft.com<br>To: jay.krell@cornell.edu<br><br>The question is: what does calling a NIL procedure do on the target? I suggest leave it for now as is for the targets that don’t do the check. What is the exception handling story for NT/x86? Why does it not work to use exception on NIL call for that target?<br>
<br><div><div>On Sep 14, 2012, at 4:41 AM, Jay K <<a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage" style="font-size:12pt;font-family:Calibri;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px"><div dir="ltr"><span style="font-family:Calibri">The front end has a lot of internal options.</span><br><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">Here is one: -check_procs.</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">It has one effect:</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">PROCEDURE Gen_Call_indirect (t: Type; cc: CallingConvention) =</font></div><div><font face="Calibri"> BEGIN</font></div><div><font face="Calibri"> IF Host.doProcChk THEN Check_nil (RuntimeError.BadMemoryReference); END;</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">Does it really make sense that we use this for NT/x86 and only NT/x86?</font></div><div><font face="Calibri">I kind of think we should use it never or use it always.</font></div><div><font face="Calibri">Or use it on all but NT/x86 -- where the exception handling mechanism is pretty well defined and easy to program. We use it on NT/x86 only (the opposite of my suggestion).</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">Using it always would bloat our code but trivially give us "safe" portable/consistent behavior.</font></div><div><font face="Calibri">The Modula-3 code would stop right away by calling portable code.</font></div><div><font face="Calibri">Instead of triggering whatever platform-specific signal/exception.</font></div><div><br></div><div><br></div><div><font face="Calibri">I happened on this code...looking at other stuff...obvious reasons if you look around...</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri"> - Jay</font></div></div></div></blockquote></div><br></div> </div></body>
</html>