Marcel Taeumel uploaded a new version of Kernel to project The Treated Inbox: http://source.squeak.org/treated/Kernel.lrnp-20231108.1534.mcz
==================== Summary ====================
Name: Kernel.lrnp-20231108.1534 Author: lrnp Time: 8 November 2023, 4:48:47.222581 pm UUID: 5f6d4eea-ca88-4757-934f-5783532f954e Ancestors: Kernel.lrnp-20231108.1533, Kernel.lrnp-20231108.1532
enforce more strict pragma access
Treat pragma access like for #primitive : they are stored on the CompiledMethod, so have CompiledBlock answer not found even if its home method has one.
Also move #hasPragma: to CompiledCode to avoid the caller needing to add a guard.
Complements the new testPragmaAccess Context test in KernelTests.lrnp-20231108.446.
I don't know if this is backwards-incompatible due to mixed use of homeMethod and method on Context. I didn't include properties because that does certainly break at least one method.
=============== Diff against Kernel-dtl.1531 ===============
Item was changed: ----- Method: BlockClosure>>homeMethod (in category 'accessing') ----- homeMethod "Answer the home method associated with the receiver. This is polymorphic with BlockClosure, CompiledCode, Context etc."
+ | maybe | + maybe := self method. + maybe ifNil: [^nil]. + ^ maybe homeMethod! - ^self method!
Item was removed: - ----- Method: CompiledBlock>>pragmaAt: (in category 'accessing-pragmas & properties') ----- - pragmaAt: aKey - "Answer the pragma with selector aKey, or nil if none." - ^self homeMethod pragmaAt: aKey!
Item was removed: - ----- Method: CompiledBlock>>pragmas (in category 'accessing-pragmas & properties') ----- - pragmas - ^self homeMethod pragmas!
Item was removed: - ----- Method: CompiledBlock>>pragmasAt: (in category 'accessing-pragmas & properties') ----- - pragmasAt: aSelector - "Answer all pragmas with selector aSelector." - ^self homeMethod pragmasAt: aSelector!
Item was added: + ----- Method: CompiledCode>>hasPragma: (in category 'accessing-pragmas & properties') ----- + hasPragma: aSymbol + + ^ (self pragmaAt: aSymbol) notNil!
Item was added: + ----- Method: CompiledCode>>pragmaAt: (in category 'accessing-pragmas & properties') ----- + pragmaAt: aKey + "Answer the pragma with selector aKey, or nil if none." + ^nil!
Item was added: + ----- Method: CompiledCode>>pragmas (in category 'accessing-pragmas & properties') ----- + pragmas + ^#()!
Item was added: + ----- Method: CompiledCode>>pragmasAt: (in category 'accessing-pragmas & properties') ----- + pragmasAt: aSelector + "Answer all pragmas with selector aSelector." + ^#()!
Item was removed: - ----- Method: CompiledMethod>>hasPragma: (in category 'accessing-pragmas & properties') ----- - hasPragma: aSymbol - - ^ (self pragmaAt: aSymbol) notNil!
Item was changed: ----- Method: Context>>homeMethod (in category 'accessing') ----- homeMethod "Answer the home method associated with the receiver. This is polymorphic with BlockClosure, CompiledCode, Context etc."
+ | maybe | + maybe := self method. + ^ (maybe isKindOf: CompiledMethod) + ifTrue: maybe + ifFalse: [maybe homeMethod]! - ^self method!
packages@lists.squeakfoundation.org