[Vm-dev] VM Maker: VMMaker.oscog-eem.3154.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Feb 11 03:00:02 UTC 2022


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3154.mcz

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

Name: VMMaker.oscog-eem.3154
Author: eem
Time: 10 February 2022, 6:59:49.141104 pm
UUID: 7a65f763-45ca-452b-a879-efbbc38030c9
Ancestors: VMMaker.oscog-eem.3153

And anotehr oops.  CoInterpreterPrimitives>>primitiveSuspend lost its validation check on teh context and list.  restore it.

=============== Diff against VMMaker.oscog-eem.3153 ===============

Item was changed:
  ----- Method: CoInterpreterPrimitives>>primitiveSuspend (in category 'process primitives') -----
  primitiveSuspend
  	"Primitive #88. Suspend the receiver, aProcess, such that it can be executed again
  	 by sending #resume. If the given process is not the active process, take it off
  	 its corresponding list.  The primitive returns the list the receiver was previously on.
  	 c.f. primitiveSuspendBackingUpV1,#568 & primitiveSuspendBackingUpV2,#578"
  	| process myList myContext ok |
  	process := self stackTop.
  	process = self activeProcess ifTrue:
  		[| inInterpreter |
  		"We're going to switch process, either to an interpreted frame or a machine
  		 code frame. To know whether to return or enter machine code we have to
  		 know from whence we came.  We could have come from the interpreter,
  		 either directly or via a machine code primitive.  We could have come from
  		 machine code.  The instructionPointer tells us where from:"
  		self stackTopPut: objectMemory nilObject.
  		inInterpreter := instructionPointer >= objectMemory startOfMemory.
  		self transferTo: self wakeHighestPriority from: CSSuspend.
  		^self forProcessPrimitiveReturnToExecutivePostContextSwitch: inInterpreter].
  	myList := objectMemory fetchPointer: MyListIndex ofObject: process.
  	myContext := objectMemory fetchPointer: SuspendedContextIndex ofObject: process.
+ 	((objectMemory isPointers: myList)
+ 	 and: [(objectMemory numSlotsOf: myList) > LastLinkIndex
+ 	 and: [(objectMemory isContext: myContext)
+ 	 and: [self isResumableContext: myContext]]]) ifFalse:
+ 		[^self primitiveFailFor: PrimErrBadReceiver].
  	ok := self removeProcess: process fromList: myList.
  	ok ifFalse:
  		[^self primitiveFailFor: PrimErrOperationFailed].
  	objectMemory storePointerUnchecked: MyListIndex ofObject: process withValue: objectMemory nilObject.
  	self stackTopPut: myList!



More information about the Vm-dev mailing list