Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primitive 64 (primitiveStringAtPut) does not fail atomically #636

Open
LinqLover opened this issue May 27, 2022 · 1 comment
Open

Primitive 64 (primitiveStringAtPut) does not fail atomically #636

LinqLover opened this issue May 27, 2022 · 1 comment

Comments

@LinqLover
Copy link
Contributor

To reproduce, in Squeak, do this:

'aaa' copy tryPrimitive: 64 withArgs: {2. $b asciiValue}; yourself

Expected behavior: The primitive fails, and the string remains aaa. This is also what we are used to from primitive 61 (primitiveAtPut).

Actual behavior: The primitive fails, but the string slot has been changed to Character null.

(By the way, TruffleSqueak and SqueakJS show my expected behavior.)

Maybe there is some clever reasoning behind it, but a primitive that fails should not have any other side effects from my first impression. Is this a bug?

@dtlewis290
Copy link
Contributor

The issue occurs with ByteString but not WideString, so "'aaa' asWideString tryPrimitive: 64 withArgs: {2. $b asciiValue}; yourself" does not show the problem, but "'aaa' copy tryPrimitive: 64 withArgs: {2. $b asciiValue}; yourself" shows the unexpected modification of the receiver.

Classic squeakvm also shows the expected behavior (the difference possibly related to Character not being immediate in the V3 object memory?).

But Cog VM with V3 image also shows the same problem, so it must not be directly related to V3 versus NewObjectMemory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants