Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Kernel-CodeModel/Context.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,12 @@ Context >> stackOfSize: limit [
^ stack
]

{ #category : 'accessing' }
Context >> stackOverflow [

self error: 'Stack overflow'
]

{ #category : 'private' }
Context >> stackPtr [
"For use only by the SystemTracer and the Debugger, Inspectors etc"
Expand Down
16 changes: 16 additions & 0 deletions src/Kernel-Extended-Tests/ProcessTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,22 @@ ProcessTest >> testSchedulingSamePriorityFirstComeFirstServed [
self assert: whichRan=2 description: 'Second scheduled process should run after'
]

{ #category : 'tests' }
ProcessTest >> testStackOverflow [

| p interceptedError |
p := [ Smalltalk createStackOverflow ] newProcess.
p shouldOverflow: true.
p
on: Error
do: [ :err | interceptedError := err ].
p resume.
[ p isTerminated ] whileFalse: [ Processor yield ].

self assert: interceptedError messageText equals: 'Stack overflow'.

]

{ #category : 'tests - termination' }
ProcessTest >> testTerminateActive [

Expand Down
13 changes: 13 additions & 0 deletions src/Kernel/Process.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Class {
'effectiveProcess',
'terminating',
'level',
'shouldOverflow',
'errorHandler'
],
#classVars : [
Expand Down Expand Up @@ -605,6 +606,18 @@ Process >> run [
] forkAt: Processor highestPriority
]

{ #category : 'accessing' }
Process >> shouldOverflow [

^ shouldOverflow
]

{ #category : 'accessing' }
Process >> shouldOverflow: aBoolean [

shouldOverflow := aBoolean
]

{ #category : 'signaling' }
Process >> signalException: anException [
"Signal an exception in the receiver process...if the receiver is currently
Expand Down
2 changes: 1 addition & 1 deletion src/System-Support/SmalltalkImage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ SmalltalkImage >> newSpecialObjectsArray [
#* 1 #/ 1 #\\ 1 #@ 1 #bitShift: 1 #// 1 #bitAnd: 1 #bitOr: 1
#at: 1 #at:put: 2 #size 0 #next 0 #nextPut: 1 #atEnd 0 #== 1 #class 0
#'~~' 1 #value 0 #value: 1 #do: 1 #new 0 #new: 1 #x 0 #y 0 ).
newArray at: 25 put: nil "was an array of 255 Characters in ascii order".
newArray at: 25 put: #stackOverflow.
newArray at: 26 put: #mustBeBoolean.
newArray at: 27 put: ByteArray.
newArray at: 28 put: nil. "was Process."
Expand Down