[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] primitiveTranslateStringWithTable modifies symbols in place, it should be reserved for non-literal strings only (#561)

Nicolas Cellier notifications at github.com
Mon Feb 21 21:27:13 UTC 2022


In modern Squeak image, literals are protected by immutability flag, and the primitive correctly check for immutability of receiver and fails. The example is thus not reproducible anymore in Squeak.

We also fail to reproduce if we use asSymbol rather than a literal:

    | s | s := 'TEST123' asSymbol.
    s translateToLowercase.
    s -> (Symbol findInterned: s)

because `Symbol>>intern:` is also protecting the symbol by sending `beReadOnlyObject`.

The fact that the Symbol is not interned: is not a VM problem, it's an implementation detail at image side.
I thus suggest to close this issue which is now correctly guarded at image side.

Cuis might still suffer from the problem, but let me suggest that Cuis do the right thing and protect Symbols from mutation too.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/561#issuecomment-1047240393
You are receiving this because you are subscribed to this thread.

Message ID: <OpenSmalltalk/opensmalltalk-vm/issues/561/1047240393 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220221/46c27a9f/attachment.html>


More information about the Vm-dev mailing list