[Vm-dev] primitiveDisplayString fails on empty Strings
lists at fniephaus.com
Wed May 23 19:11:30 UTC 2018
I noticed that BitBlt's primitiveDisplayString fails relatively often and
then found out that it's sometimes called to draw empty strings.
`(ByteString allInstances select: [:ea | ea isEmpty]) size` revealed that
there are 2245 empty strings in my image and I assume some of them must be
either in the FrameRateMorph morph or in the Clock morph.
Anyway...looking at BitBlt>>#primDisplayString:from:to:map:xTable:kern:,
the fallback code basically does nothing if stopIndex is zero (`startIndex
to: stopIndex do: ...`) which makes sense.
What I think doesn't make sense is that the primitive fails in the first
place. Instead of failing if stopIndex is not greater 0, I would suggest to
use: `stopIndex < 1 ifTrue: [^ interpreterProxy pop: 6].` which cleans up
the stack, leaves the receiver, and returns early.
Let me know what you think!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev