[squeak-dev] [5.2a] styled text in a class comment spawns endless subscript out-of-bounds

Bob Arning arning315 at comcast.net
Thu Jul 5 18:49:54 UTC 2018


Well, that drops styling altogether if it is not exactly right. You 
could try to patch up the runs with:

aRunArray size > aString size ifTrue: [aRunArray := aRunArray copy from: 
1 to aString size].

aRunArray size < aString size ifTrue: [aRunArray addLast: {} times: 
aString size - aRunArray size].


On 7/5/18 2:32 PM, K K Subbu wrote:
> On Thursday 05 July 2018 10:09 PM, Bob Arning wrote:
>> A useful step would be to check this:
>>
>> (Text allInstances select: [ :e | e size ~= e runs size]) explore
>>
>> and see if it finds anything. If people did it periodically (like 
>> before and after loading new code from somewhere) we might know 
>> if/how these anomalies might be created.
>>
> Text drops bad runs silently in:
>
> setString: aString setRunsChecking: aRunArray
>     ...
>     aRunArray size = aString size ifFalse: [^ aString asText].
>     runs := aRunArray
>
> This method is called from PositionableStream>>#nextChunkText but not 
> from #nextChunkTextFromStream: methods of converter used by 
> MultiByteFileStream.
>
> Should these methods be changed to check runs? or should we catch the 
> error in MultiByteStream>>#nextChunkText post conversion?
>
> Regards .. Subbu
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180705/4160096f/attachment.html>


More information about the Squeak-dev mailing list