<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
See below:<BR>
>> The line number is in an integer along with a 5 bit fault code.<BR><BR>
Maybe that isn't clear -- they are in the same integer, 32bits or 64bits.<BR>
4 billion / 32 is roughly 100 million.<BR>
<BR>
- Jay<BR> <BR>
<HR id=stopSpelling>
Date: Wed, 7 Jul 2010 11:56:43 +0800<BR>From: ttmrichter@gmail.com<BR>To: m3devel@elegosoft.com<BR>Subject: Re: [M3devel] fault reports beyond 100mill lines?<BR><BR>Why the magic number of 100,000,000? Why not 4 billion, say?<BR><BR>
<DIV class=ecxgmail_quote>On 7 July 2010 04:35, Jay K <SPAN dir=ltr><<A href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</A>></SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; PADDING-LEFT: 1ex" class=ecxgmail_quote><BR>I'm pretty settled on silently losing line numbers over 100 million.<BR>If the host and target are 64 bits it preserves far more.<BR>If someone produces such a file, and it compiles and runs, but gets a runtime error in their code on the wrong line, they can claim they found a compiler bug...<BR>
<DIV class=ecxim><BR> - Jay<BR><BR>----------------------------------------<BR>> From: <A href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</A><BR></DIV>> To: <A href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</A><BR>> Date: Tue, 6 Jul 2010 20:21:08 +0000<BR>> Subject: [M3devel] fault reports beyond 100mill lines?<BR>
<DIV>
<DIV></DIV>
<DIV class=h5>><BR>><BR>> It appears that if a file has over around 100 million lines, that fault reports (nil deref, subrange out of bounds, etc.) get the wrong line number.<BR>> Leave it as ("qualit of implementation"?) or fail an assertion in the compiler earlier (leaving anyone with a huge file kind of stuck (generated?) or, unlikely, expand the range?<BR>> The line number is in an integer along with a 5 bit fault code.<BR>> We could also allow much larger numbers on 64bit targets.<BR>><BR>><BR>> This is just because there's a "FIXME" comment in parse.c.<BR>> The code is basically right and I'm adding comments and perhaps assertions.<BR>> Certainly we can assert that the fault code is in range.<BR>><BR>><BR>> I think I prefer silently losing bits in the line number, or conveting it to 0 if it is out of bounds or pinning it to maxint.<BR>> Though it'd be maxint / 32 which is less "special" looking if someone ever saw it.. though the runtime could<BR>> report maxint / 32 as maxint.<BR>><BR>> - Jay<BR>><BR>><BR> </DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."<BR>--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.<BR> </body>
</html>