The Inbox: Kernel-jar.1404.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Kernel-jar.1404.mcz

commits-2
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1404.mcz

==================== Summary ====================

Name: Kernel-jar.1404
Author: jar
Time: 12 May 2021, 1:10:44.824502 pm
UUID: 8ca0f049-7c9d-ac43-befc-828adc37e6bd
Ancestors: Kernel-nice.1402

Prevent VM crashes due to returning from #cannotReturn. The fix loops #cannotReturn to itself so that the user cannot crash the VM by accidentally pressing Proceed, by stepping over etc.

#terminate can take advantage of this improved behavior - will post a proposal in a separate changeset.

=============== Diff against Kernel-nice.1402 ===============

Item was changed:
  ----- Method: Context>>cannotReturn: (in category 'private-exceptions') -----
  cannotReturn: result
+ "Note: BlockCannotReturn is looped back because returning to thisContext's sender (i.e. to self) wouldn't make sense and would crash the VM - the sender's pc was set to endPC+1 because the sender attempted an illegal non-local return (to a dead context or a to context on another stack). This message is sent by the VM or during simulation."
 
+ closureOrNil ifNotNil: [self cannotReturn: result to: self home sender. thisContext privRefresh].
- closureOrNil ifNotNil: [^ self cannotReturn: result to: self home sender].
  Processor debugWithTitle: 'Computation has been terminated!!' translated full: false.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-jar.1404.mcz

Christoph Thiede
Hi Jaromir!

> Example previously crashing the VM:
>
> [^2] fork

Nice catch! :-)

Please see Kernel-ct.1405 for a counterproposal and explanation. Despite the
attached wall of text, I'm not actually sure about the semantics of
impossible returns, so I'm looking forward to your feedback. :-)

Best,
Christoph



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!