Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz ==================== Summary ==================== Name: Kernel-eem.1367 Author: eem Time: 1 February 2021, 6:57:09.713484 pm UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad Ancestors: Kernel-eem.1366 Fix mistake in the previous commit. Thanks Levente! =============== Diff against Kernel-eem.1366 =============== Item was changed: ----- Method: Context>>isPrimFailToken: (in category 'private') ----- + isPrimFailToken: contextOrPrimFailToken + "Answer if contextOrPrimFailToken, which will either be a Context object or + a primitive fail token (a tuple of the PrimitiveFailToken unique object and + a primitive failure code), is the latter. This should only be used with the + (possibly indirect) results of Context>>doPrimitive:method:receiver:args:" + ^contextOrPrimFailToken isArray + and: [contextOrPrimFailToken size = 2 + and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]! - isPrimFailToken: anObject - ^(self objectClass: anObject) isArray - and: [anObject size = 2 - and: [(anObject at: 1) == PrimitiveFailToken]]! |
Hi Eliot,
thanks for the fix! Sorry for raising the same question again, but wouldn't it still be safer to dispense with the #isArray call here? It allows the simulated code to break out of the simulation by overriding #isArray anywhere. I think I posted a proof of concept here: http://forum.world.st/The-Trunk-Kernel-eem-1366-mcz-tp5126558p5126713.html :-) Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 2. Februar 2021 03:57:12 An: [hidden email]; [hidden email] Betreff: [squeak-dev] The Trunk: Kernel-eem.1367.mcz Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz ==================== Summary ==================== Name: Kernel-eem.1367 Author: eem Time: 1 February 2021, 6:57:09.713484 pm UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad Ancestors: Kernel-eem.1366 Fix mistake in the previous commit. Thanks Levente! =============== Diff against Kernel-eem.1366 =============== Item was changed: ----- Method: Context>>isPrimFailToken: (in category 'private') ----- + isPrimFailToken: contextOrPrimFailToken + "Answer if contextOrPrimFailToken, which will either be a Context object or + a primitive fail token (a tuple of the PrimitiveFailToken unique object and + a primitive failure code), is the latter. This should only be used with the + (possibly indirect) results of Context>>doPrimitive:method:receiver:args:" + ^contextOrPrimFailToken isArray + and: [contextOrPrimFailToken size = 2 + and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]! - isPrimFailToken: anObject - ^(self objectClass: anObject) isArray - and: [anObject size = 2 - and: [(anObject at: 1) == PrimitiveFailToken]]!
Carpe Squeak!
|
Hi Christoph,
On Mar 2, 2021, at 5:17 AM, Thiede, Christoph <[hidden email]> wrote:
As I understand it no. The clue is in the variable name. contextOrPrimFailToken can only ever be a Context or an Array, so the send of isArray serves only to quickly differentiate between a Context and an Array. The message doesn’t get sent to any other kinds of object at that point so the concern that other classes may define isArray does not apply here.
|
Hi Eliot,
then I think there is an issue with the argument name. In #callPrimitive:, for example, it is named more specifically, maybePrimFailToken. In #doPrimitive:method:receiver:args:, we may feed it with the result of #tryPrimitive:withArgs: which can be anything, not only a context or fail token.
Here is a second example:
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Dienstag, 2. März 2021 16:27 Uhr An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Trunk: Kernel-eem.1367.mcz Hi Christoph,
On Mar 2, 2021, at 5:17 AM, Thiede, Christoph <[hidden email]> wrote:
As I understand it no. The clue is in the variable name. contextOrPrimFailToken can only ever be a Context or an Array, so the send of isArray serves only to quickly differentiate between a Context and an Array. The message doesn’t get sent to any other kinds of object at that point so the concern that other classes may define isArray does not apply here.
Carpe Squeak!
|
On Mar 2, 2021, at 8:21 AM, Thiede, Christoph <[hidden email]> wrote:
|
Hi Eliot,
I have just found another bug that is caused by this change: You cannot debug MirrorPrimitiveTest >> #testMirrorClass any longer - more in general, you cannot debug "ProtoObject new" any longer, because the return value of primitiveNew does not understand #isArray. I think this is very clearly a bug? :-)
Best, Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Dienstag, 2. März 2021 18:05:37 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Trunk: Kernel-eem.1367.mcz On Mar 2, 2021, at 8:21 AM, Thiede, Christoph <[hidden email]> wrote:
Carpe Squeak!
|
Free forum by Nabble | Edit this page |