[Vm-dev] VM Maker: VMMaker.oscog-nice.2732.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 23 23:41:19 UTC 2020


Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2732.mcz

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

Name: VMMaker.oscog-nice.2732
Author: nice
Time: 24 March 2020, 12:40:36.561235 am
UUID: e0800e83-2731-9a4c-89f8-b7444f5e05d5
Ancestors: VMMaker.oscog-eem.2731

Fix bad bad copy/past error in generateSignedShiftRight:on:indent:

This broke B2DPlugin and probably other things (see senders of signedBitShift: and >>>)

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

Item was changed:
  ----- Method: CCodeGenerator>>generateSignedShiftRight:on:indent: (in category 'C translation') -----
  generateSignedShiftRight: msgNode on: aStream indent: level
  	"Generate the C code for >>> onto the given stream."
  
  	| type typeIsUnsigned mustCastToSigned signedType |
  	type := self typeFor: msgNode receiver in: currentMethod.
  	typeIsUnsigned := type first = $u.
  	mustCastToSigned := typeIsUnsigned or:
  		["cast to sqInt if the int is shorter: we want to avoid UB related to a shift exceeeding bit width"
  		(self sizeOfIntegralCType: type) < (self sizeOfIntegralCType: #usqInt)].
  	mustCastToSigned
  		ifTrue:
  			["If the variable is a 64-bit type then don't cast it to usqInt (typically a 32-bit type)"
  			signedType := (self sizeOfIntegralCType: type) < (self sizeOfIntegralCType: #usqLong)
+ 				ifTrue: [#sqInt]
- 				ifTrue: [#usqInt]
  				ifFalse: [self signedTypeForIntegralType: type].
  			 aStream nextPutAll: '(('; nextPutAll: signedType; nextPutAll: ')('.
  			 self emitCExpression: msgNode receiver on: aStream indent: level.
  			 aStream nextPutAll: '))']
  		ifFalse:
  			[aStream nextPutAll: '('.
  			 self emitCExpression: msgNode receiver on: aStream indent: level.
  			 aStream nextPut: $)].
  	aStream nextPutAll: ' >> '.
  	self emitCExpression: msgNode args first on: aStream!



More information about the Vm-dev mailing list