Thread overview | |||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 10, 2002 dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Walter, If you have a prefered bug reporting method let me know. Also it might be nice if you would put a version or build number in the compler banner to refer to. ================= The following causes my dmd.exe to exception with a null pointer reference. import stream; // http://int19h.tamb.ru/files.html void Bar(int input) { } int main(char[][] args) { Bar(stream); return 0; } |
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | Posting them here is fine. I thought the banner did put out the version number. Execute DMD with no arguments. "Patrick Down" <pat@codemoon.com> wrote in message news:Xns920A3EEB2579patcodemooncom@63.105.9.61... > Walter, > > If you have a prefered bug reporting method let me > know. Also it might be nice if you would put a > version or build number in the compler banner to > refer to. > > ================= > > The following causes my dmd.exe to exception with a > null pointer reference. > > import stream; // http://int19h.tamb.ru/files.html > > void Bar(int input) > { > } > > int main(char[][] args) > { > Bar(stream); > > return 0; > } |
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in news:abfp0m$1qa8$1 @digitaldaemon.com:
> Posting them here is fine. I thought the banner did put out the version number. Execute DMD with no arguments.
You are right it does print the version it has no arguments.
===================
The next one's a little weard. When I run the following
code it prints...
here1
here2
err2
Then it hangs after printing err2.
I don't know if this is your's or Pavel's. I suspect
that MemoryStream.writeBlock is throwing the error but
I don't know why the program hangs.
import stream;
int main(char[][] args)
{
try
{
printf("here1\n");
char[] foo =
"variable=value\n"
"var=value\n";
MemoryStream strm;
printf("here2\n");
strm.writeString(foo);
printf("here3\n");
}
catch(WriteError e)
{
printf("err1\n");
}
catch(Exception e)
{
printf("err2\n");
}
return 0;
}
|
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | "Patrick Down" <pat@codemoon.com> wrote in message news:Xns920A143BCE8FCpatcodemooncom@63.105.9.61... > Then it hangs after printing err2. > I don't know if this is your's or Pavel's. I suspect > that MemoryStream.writeBlock is throwing the error but > I don't know why the program hangs. Nah, it's not my fault. Let's see how it goes. writeString() calls writeExact(), which in turn calls writeBlock(). Since MemoryStream is just a wrapper around OutBuffer, it calls OutBuffer.write() - which throws an exception "overlapping array copy". You can check it yourself. Try: import outbuffer, c.stdio; int main(char[][] args) { try { printf("start\n"); char[] s = "foo"; OutBuffer strm; printf("writing..."); strm.write(s); printf("done\n"); } catch (Exception e) printf("\nError: %.*s\n", e.msg); return 0; } |
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | Patrick Down <pat@codemoon.com> wrote in news:Xns920A143BCE8FCpatcodemooncom@63.105.9.61: > MemoryStream strm; Aggg! I'm still thinking C++! Sorry for the false alarm. MemoryStream strm = new MemoryStream; |
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | "Patrick Down" <pat@codemoon.com> wrote in message news:Xns920A56844ACEFpatcodemooncom@63.105.9.61... > Aggg! I'm still thinking C++! Sorry for the > false alarm. > > MemoryStream strm = new MemoryStream; Hah! I didn't notice it as well! =) Shame on me! |
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | In article <abgl73$2jq4$1@digitaldaemon.com>, Pavel Minayev says... > >"Patrick Down" <pat@codemoon.com> wrote in message news:Xns920A56844ACEFpatcodemooncom@63.105.9.61... > >> Aggg! I'm still thinking C++! Sorry for the >> false alarm. >> >> MemoryStream strm = new MemoryStream; > >Hah! I didn't notice it as well! =) Shame on me! > Well... well... What about to have a run-time check against calling null references instead of having the system hung... Frankly, it would be very useful. Since I'm a stupid C++ programmer and I always forget to initialize object instances with an explicit 'new'. Tamas Nagy |
May 10, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to MicroWizard | "MicroWizard" <MicroWizard_member@pathlink.com> wrote in message news:abh43c$30k2$1@digitaldaemon.com... > What about to have a run-time check against calling null references instead of having the system hung... > > Frankly, it would be very useful. Since I'm a stupid C++ programmer > and I always forget to initialize object instances with an explicit 'new'. We're discussing it for the last few days already =) |
May 11, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | Is this right? err.d(2): cannot have out parameter of type bit void foo(out bit bar) { bar = true; } int main(char[][] args) { bit a; foo(a); return 0; } |
May 11, 2002 Re: dmd 30 bugs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | "Patrick Down" <pat@codemoon.com> wrote in message news:Xns920B30A21022patcodemooncom@63.105.9.61... > Is this right? > err.d(2): cannot have out parameter of type bit There can be no pointers to bits. Since out parameters are implicitly dereferenced pointers, they cannot be bit. |
Copyright © 1999-2021 by the D Language Foundation