[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Incorrect literal Character encoding/decoding in SistaV1 bytecode set (Issue #618)

Nicolas Cellier notifications at github.com
Wed Mar 9 20:25:28 UTC 2022


As reported by Marcel on Squeak-dev, this snippet:

    Compiler evaluate: (String with: $$ with: (Character value: 16r8000)).

will return a Character with a negative value (-32768).

This is because character literal in the range 16r100-16rFFFF are encoded with an extended B bytecode, and the extended B is interpreted as signed value.

I suggested
- a workaround : using `(extB bitAnd: 16rFF) << 8` to reconstruct an unsigned Character value
- a fix: using extA instead of extB so as to have it interpreted unsigned

See https://source.squeak.org/VMMakerInbox/VMMaker.oscog-nice.3174.diff for the former solution.

The later solution require more changes and a careful recompilation of CompiledMethods at image side.



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

Message ID: <OpenSmalltalk/opensmalltalk-vm/issues/618 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220309/d35b6547/attachment.html>


More information about the Vm-dev mailing list