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

commits at source.squeak.org commits at source.squeak.org
Sun Sep 27 23:28:11 UTC 2020


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

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

Name: VMMaker.oscog-eem.2830
Author: eem
Time: 27 September 2020, 4:28:02.555901 pm
UUID: b30cd73c-7118-461b-9d8a-1c523c6aa011
Ancestors: VMMaker.oscog-eem.2829

lien/IA32ABIPlugin: Fix one more slip in primAlienCopyInto

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

Item was changed:
  ----- Method: IA32ABIPlugin>>primAlienCopyInto (in category 'primitives-accessing') -----
  primAlienCopyInto
  	"Copy some number of bytes from the receiver starting at the first index into some destination
  	 object starting at the second index.  The  destination may be an Aliens or a bit-indexable object.
  	 The primitive will have the following signature:
  	<Alien>
  		primCopyFrom: start <Integer>
  		to: stop <Integer>
  		into: destination <Alien | indexableByteSubclass et al>
  		startingAt: destStart <Integer> ^<self>
  		<primitive: 'primitiveAlienReplace' error: errorCode module: 'IA32ABI'>
  	"
  	<export: true>
  	| alien start stop dest destStart src totalLength destAddr myLength |
  	alien := interpreterProxy stackValue: 4.  "Unchecked!!"
  	start := interpreterProxy stackIntegerValue: 3.
  	stop := interpreterProxy stackIntegerValue: 2.
  	dest := interpreterProxy stackValue: 1.
  	destStart := interpreterProxy stackIntegerValue: 0.
  
  	(interpreterProxy failed
  	 or: [(interpreterProxy isWordsOrBytes: dest) not]) ifTrue:
  		[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
  
  	myLength := self sizeField: alien.
+ 	src := (self startOfData: alien withSize: myLength) + start - 1.
- 	src := (self startOfData: dest withSize: myLength) + start - 1.
  
  	(self isAlien: dest)
  		ifTrue:
  			[totalLength := self sizeField: dest.
  			 destAddr := (self startOfData: dest withSize: totalLength) + start - 1.
  			 totalLength = 0 "no bounds checks for zero-sized (pointer) Aliens"
  				ifTrue: [totalLength := stop]
  				ifFalse: [totalLength := totalLength abs]]
  		ifFalse:
  			[totalLength := interpreterProxy byteSizeOf: dest.
  			 destAddr := (self startOfByteData: dest) + start - 1].
  
  	((start >= 1 and: [start - 1 <= stop and: [stop <= myLength abs]])
  	 and: [stop - start + 1 <= totalLength]) ifFalse:
  		[^interpreterProxy primitiveFailFor: PrimErrBadIndex].
  
  	(interpreterProxy isOopImmutable: dest) ifTrue:
  		[^interpreterProxy primitiveFailFor: PrimErrNoModification].
  
  	"Use memmove to allow source and desition to overlap"
  	self memmove: destAddr asVoidPointer _: src asVoidPointer _: stop - start + 1.
  
  	interpreterProxy methodReturnReceiver!



More information about the Vm-dev mailing list