From: forsyth@caldo.demon.co.uk
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Inferno, Limbo unexpectancies
Date: Thu, 14 Feb 2002 15:40:40 +0000 [thread overview]
Message-ID: <20020214153452.6CD4D199BB@mail.cse.psu.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
>>1 shadowing
shad.b:12: warning: redeclaration of local n, previously declared as a local on line shad.b:10
request warnings and you'll get them (-w option to limbo)
>>2 no bounds check in JIT
there's a plan to make them available in JIT mode as well.
(at least optionally: there are some things that can be proved
correct and don't need them but could use the speed.)
[-- Attachment #2: Type: message/rfc822, Size: 3177 bytes --]
To: 9fans@cse.psu.edu
Subject: [9fans] Inferno, Limbo unexpectancies
Date: Thu, 14 Feb 2002 16:05:15 +0100 (MET)
Message-ID: <200202141505.g1EF5FP01844@cbe.ericsson.se>
With the Inferno mail list down I hope to reach 'the right people' here at
9fans.
If Inferno related emails are considered bandwith waisting, please let me know
and I will stop.
I have stumbled upon 2 things in Limbo that I would like to warn about
(presumably somebody else is as stupid as I am :-)
1 Unintended variable shadowing:
n := 3
while (n > 0) {
n:= n - 1; # i know of n--, but this is an example
}
as is obvious (afterwards), n will never reach 0.
i really think the compiler should warn about this.
2 No array bounds checking (only for JIT):
The below program will crash at the return statement in crash(), not in the
for() loop. Moreover, this only happens when using JIT.
bengt
implement Crash;
include "draw.m";
include "sys.m";
sys: Sys;
Crash: module {
init: fn(nil: ref Draw->Context, args: list of string);
};
init(nil: ref Draw->Context, args: list of string) {
sys = load Sys Sys->PATH;
a:= crash( );
return;
}
crash( ): array of byte {
result:= array [1] of byte;
for (i:= 0; i < 10; i++) {
sys->print( "%d\n", i );
result[i] = byte 0;
sys->print( "%d\n", len result );
}
return result[:5];
}
next reply other threads:[~2002-02-14 15:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-14 15:40 forsyth [this message]
2002-02-18 10:13 ` Maarit Maliniemi
-- strict thread matches above, loose matches on Subject: below --
2002-02-15 12:52 Bengt Kleberg
2002-02-14 15:43 forsyth
2002-02-15 0:48 ` Sam Ducksworth
2002-02-14 15:05 Bengt Kleberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020214153452.6CD4D199BB@mail.cse.psu.edu \
--to=forsyth@caldo.demon.co.uk \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).