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.

Try this.  (The incrementTally change is only for efficiency).

--- orig/compiler/ParseTreeSearcher.st
+++ mod/compiler/ParseTreeSearcher.st
@@ -277,6 +277,17 @@ LookupTable variableSubclass: #RBSmallDi

 !RBSmallDictionary methodsFor: 'private'!

+whileGrowingAt: key put: value
+    tally := tally + 1.
+    self primAt: self size put: key.
+    self valueAt: self size put: value!
+
+incrementTally
+    tally := tally + 1.
+    ^tally > self primSize
+        ifTrue: [ self grow ];
+        yourself!
+
 findIndex: anObject
"Tries to see if anObject exists as an indexed variable. As soon as nil
     or anObject is found, the index of that slot is answered"
@@ -288,6 +299,7 @@ findIndex: anObject
         (element isNil or: [ element = anObject ])
             ifTrue: [ ^i ]
     ].
+    tally = self primSize ifTrue: [ self grow ].
     ^self size + 1! !

 RBSmallDictionary class

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to