Search the web
Sign In
New User? Sign Up
GPCP · Gardens Point Component Pascal
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Is this a GPCP bug?   Message List  
Reply | Forward Message #427 of 437 |
Re: Is this a GPCP bug?

--- In GPCP@yahoogroups.com, "Marc Martin" <marc@...> wrote:
>
> Yes, in the original code, this was part of an initialization sequence.
> The debugger claims that the crash happens with the assignment, not
> with an access.
>
> But certainly using str := ""; works for initialization purposes as well...
>

Sorry, my mistake, I misread your original message. Your question makes a lot
more sense to me now! You are right - it shouldn't crash when you assign:

str := NIL;

As System.String is a POINTER TO A RECORD.

However, in practice it looks like the problem is related to the way GPCP
attempts to provide convenient automatic interchangeability between .NET's
System.String and CP's ARRAY OF CHAR.

If you look at the IL code generated for this statement:

.line 8,8:6,9 'NullString.cp'
ldnull
call string [RTS]CP_rts::mkStr(wchar[])
stsfld string NullString.NullString::'str'

You can see that it is effectively making a call to MKSTR behind the scenes. I
presume that passing a null value to the mkStr function is what is generating
the exception.

Regards,
Chris







Thu Jul 2, 2009 2:42 am

cfbsoftware1
Offline Offline
Send Email Send Email

Forward
Message #427 of 437 |
Expand Messages Author Sort by Date

Hi all, I noticed that if I assign a System.String to NIL, the code will crash with an error in RTS.dll. I'm wondering if this is a GPCP bug, of I am...
Marc Martin
marcmartin2
Offline Send Email
Jul 1, 2009
6:06 pm

... There is no problem assigning NIL to str, but there certainly is a problem if you then try to access that variable. Efectively you are telling the system...
cfbsoftware1
Offline Send Email
Jul 2, 2009
12:29 am

... Yes, in the original code, this was part of an initialization sequence. The debugger claims that the crash happens with the assignment, not with an access....
Marc Martin
marcmartin2
Offline Send Email
Jul 2, 2009
1:48 am

... Sorry, my mistake, I misread your original message. Your question makes a lot more sense to me now! You are right - it shouldn't crash when you assign: str...
cfbsoftware1
Offline Send Email
Jul 2, 2009
2:42 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help