[squeak-dev] The Inbox: Kernel-ct.1409.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Aug 22 16:18:08 UTC 2021
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1409.mcz
==================== Summary ====================
Name: Kernel-ct.1409
Author: ct
Time: 22 August 2021, 6:18:06.141465 pm
UUID: 003f761f-f99d-c245-a431-dcf1cb8405ba
Ancestors: Kernel-eem.1408
Fixes a simulation bug when returning from a sender that is a bottom context.
Examples to reproduce:
- sender := thisContext swapSender: nil.
^1
- sender := thisContext swapSender: nil.
true ifTrue: [^ 1].
- [sender := thisContext swapSender: nil.
true ifTrue: [^ 1]] value.
Without this patch, #return:from: would return nil instead of activating #cannotReturn: so simulating instead of executing e.g. the first example would not open the expected "computation terminated" debugger. See http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-May/215762.html for more information.
Thanks to Jaromir (jar) for pointing to this bug!
=============== Diff against Kernel-eem.1408 ===============
Item was changed:
----- Method: Context>>return:from: (in category 'instruction decoding') -----
return: value from: aSender
"For simulation. Roll back self to aSender and return value from it. Execute any unwind blocks on the way. ASSUMES aSender is a sender of self"
| newTop |
aSender isDead ifTrue:
[^self send: #cannotReturn: to: self with: {value}].
newTop := aSender sender.
+ newTop ifNil:
+ [^self send: #cannotReturn: to: self with: {value}].
(self findNextUnwindContextUpTo: newTop) ifNotNil:
[:unwindProtectCtxt|
^self send: #aboutToReturn:through: to: self with: {value. unwindProtectCtxt}].
self releaseTo: newTop.
newTop ifNotNil: [newTop push: value].
^newTop!
More information about the Squeak-dev
mailing list
|