Fix subscript out of bounds error in Smalltalk inderences
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 25 Oct 2017 23:42:41 +0100
changeset 1058 6d4bf422a7dd
parent 1057 961ccf692782
child 1059 acfcb242f75e
Fix subscript out of bounds error in Smalltalk inderences ...caused by missing size-check when analysing typed prefix.
SmallSense__SmalltalkInferencer.st
--- a/SmallSense__SmalltalkInferencer.st	Wed Oct 18 11:33:21 2017 +0100
+++ b/SmallSense__SmalltalkInferencer.st	Wed Oct 25 23:42:41 2017 +0100
@@ -718,7 +718,7 @@
 
     name := anObject name.
     (name size > 1 and:[name first == $a]) ifTrue:[ 
-        (name second == $n and:[ name third isUppercase ]) ifTrue:[ 
+        (name size > 2 and: [name second == $n and:[ name third isUppercase ]]) ifTrue:[ 
             className := (name copyFrom: 3) asSymbolIfInterned.
         ] ifFalse:[ name second isUppercase ifTrue:[
             className := (name copyFrom: 2) asSymbolIfInterned.
@@ -734,6 +734,7 @@
     ].
 
     "Created: / 06-07-2017 / 16:15:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-10-2017 / 23:39:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkInferencer class methodsFor:'documentation'!