StackOverflow when inspecting '40' >= 40

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

StackOverflow when inspecting '40' >= 40

Postby Yuri » Tue Feb 24, 2009 7:02 am

Gents,

Working on some Smalltalk code I discovered a little bug in VAST 7.5.0:

Inspect this in your Transcript or Workspace and you will be represented by a nice Stackoverflow error
Code: Select all
'40' >= 40

When looking in the source code which dates from 1996 in the String(EsString) implementation, it says:
Code: Select all
>= aString

   "Answer a Boolean which is true if the receiver collates after
    aString or the same as aString and false otherwise. The collation
    sequence ignores the case of the Characters.

    Fail if aString is not a String."

   ^aString <= self

But it never fails and passes the operation to the arguments' implementation. At the Smallinteger(Number) implementation the code looks like:
Code: Select all
<= aNumber

   "Answer a Boolean indicating true if the receiver is less
    than or equal to the argument, aNumber; otherwise answer
    false.

    Fail if aNumber is not a type of Number."

   ^(aNumber < self) not

And thus results in an endless loop. There is no check in either method on the argument's type and none of the implementations throws an Error.

Will this be fixed in VAST 8.0?

Regards, Yuri.
Yuri
 
Posts: 9
Joined: Thu Feb 12, 2009 2:54 am
Location: The Netherlands, Waalwijk or 's-Hertogenbosch

Re: StackOverflow when inspecting '40' >= 40

Postby wembley » Tue Feb 24, 2009 11:28 am

Yuri -

Case 39287 has been opened for this problem. It will be fixed in V8 Beta 2. Instead of ExStackOverflow, you will get ExCLDTInvalidClass immediately.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: StackOverflow when inspecting '40' >= 40

Postby Yuri » Tue Feb 24, 2009 11:45 pm

wembley wrote:Yuri -

Case 39287 has been opened for this problem. It will be fixed in V8 Beta 2. Instead of ExStackOverflow, you will get ExCLDTInvalidClass immediately.


John,

Thanks for the fast reply, do you have any idea when beta 2 will be shipping?

Kind regards,

Yuri.
Yuri
 
Posts: 9
Joined: Thu Feb 12, 2009 2:54 am
Location: The Netherlands, Waalwijk or 's-Hertogenbosch


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest