help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] copying RBSmallDictionary


From: Stephen Compall
Subject: Re: [Help-smalltalk] copying RBSmallDictionary
Date: Tue, 09 Jan 2007 22:47:20 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.9) Gecko/20061211 SeaMonkey/1.0.7

Stephen Compall wrote:
Can anyone tell me why this happens:

st> PackageLoader fileInPackage: 'Parser'!
...
st> STInST.RBSmallDictionary new at: 1 put: 2; copy! Object: RBSmallDictionary new: 1 "<-0x4c6f1798>" error: Invalid index 2: index out of range
SystemExceptions.IndexOutOfRange(Smalltalk.Exception)>>#signal
SystemExceptions.IndexOutOfRange class>>#signalOn:withIndex:
STInST.RBSmallDictionary(Smalltalk.Object)>>#checkIndexableBounds:put:
STInST.RBSmallDictionary(Smalltalk.Object)>>#basicAt:put:
STInST.RBSmallDictionary(Smalltalk.LookupTable)>>#valueAt:put:
STInST.RBSmallDictionary(Smalltalk.LookupTable)>>#whileGrowingAt:put:
STInST.RBSmallDictionary(Smalltalk.LookupTable)>>#copyAllFrom:
STInST.RBSmallDictionary(Smalltalk.HashedCollection)>>#shallowCopy
STInST.RBSmallDictionary(Smalltalk.Object)>>#copy
Smalltalk.UndefinedObject>>#executeStatements

This happens because RBSmallDictionary>>#findIndex: is wrong for LookupTable, which expects a valid index. I fixed this by removing RBSmallDictionary class>>#new: outright. I think this could also be fixed with more faith to the original by using primNew: instead of basicNew: in that method, but it doesn't bother me that much.

--
Stephen Compall
http://scompall.nocandysw.com/blog




reply via email to

[Prev in Thread] Current Thread [Next in Thread]