Christoph Thiede uploaded a new version of Kernel to project The Treated Inbox: http://source.squeak.org/treated/Kernel-jar.1535.mcz
==================== Summary ====================
Name: Kernel-jar.1535 Author: jar Time: 19 November 2023, 6:34:30.215053 pm UUID: d384c660-ec50-3e49-aa7e-1dba3227105b Ancestors: Kernel-mt.1534
Fix incorrect / inconsistent behavior after resuming from BCR exception.
Consider the following examples:
[[^ 1] on: BlockCannotReturn do: #resume ] fork. "VM crash"
[[true ifTrue: [^ 1]] on: BlockCannotReturn do: #resume ] fork. "Illegal return from ^1"
Explanation: In the first example the VM places a #cannotReturn context on top of the [^1] context which at this time has pc past the last bytecode instruction and thus the VM crashes when attempting to return here. In the second example the pc is past the return, but more bytecodes follow so the return from #cannotReturn context can happily continue, however, this continuing is "illegal" in the sense it should not have happened. The two examples should consistently cause a walk-back indicating an illegal return attempt.
Complemented by a change in the Debugger to correctly debug this situation: Tools-jar.1240
=============== Diff against Kernel-mt.1534 ===============
Item was changed: ----- Method: Context>>cannotReturn: (in category 'private-exceptions') ----- cannotReturn: result + "NB: Nil the receiver's pc to make sure it can't resume; backup the pc before nilling for the sake of debugging. + Check Debugger >> #checkContextSelection for a debuuger support when resuming from the BCR exception. + Example: + Without nilling the pc the following example would crash the VM after resumption: + [[^ 1] on: BlockCannotReturn do: #resume ] fork + and the following example would run and happily execute an illegal return after resumption: + [[true ifTrue: [^ 1]] on: BlockCannotReturn do: #resume ] fork + "
+ closureOrNil ifNotNil: [^self cannotReturn: result to: self home sender; push: pc; pc: nil]. + Processor debugWithTitle: 'Computation has been terminated!!' translated full: false! - closureOrNil ifNotNil: [^ self cannotReturn: result to: self home sender]. - Processor debugWithTitle: 'Computation has been terminated!!' translated full: false.!
packages@lists.squeakfoundation.org