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

Bug in InterpreterPrimitives >> primitiveNotIdentical #727

Open
PalumboN opened this issue Jan 8, 2024 · 1 comment
Open

Bug in InterpreterPrimitives >> primitiveNotIdentical #727

PalumboN opened this issue Jan 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@PalumboN
Copy link
Collaborator

PalumboN commented Jan 8, 2024

The primitive is mixing receiver and argument when should following otherObject.

{ #category : #'object access primitives' }
InterpreterPrimitives >> primitiveNotIdentical [
"is the receiver/first argument not the same object as the (last) argument?.
pop argumentCount because this can be used as a mirror primitive."
| thisObject otherObject |
otherObject := self stackValue: 1.
thisObject := self stackTop.
(objectMemory isOopForwarded: otherObject) ifTrue:
[self assert: argumentCount > 1.
otherObject := objectMemory followForwarded: thisObject].
(objectMemory isOopForwarded: thisObject) ifTrue:
[thisObject := objectMemory followForwarded: thisObject].
self pop: argumentCount + 1 thenPushBool: thisObject ~= otherObject
]

I don't know if the case never arrived because of:

  • special selectors - always enter through the "inlined" bytecode -> In that case, is the primitive necessary?
  • Never forwarded - Is the argument resolved before the call? -> In that case, is the check necessary in the definition?
  • JIT compiler - the primitive is always jitted, so this function is invoked almost never.
@PalumboN PalumboN added the bug Something isn't working label Jan 8, 2024
@guillep
Copy link
Member

guillep commented Jan 9, 2024

good catch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants