[Vm-dev] VM Maker: VMMaker.oscog-mt.3069.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Sep 16 08:44:29 UTC 2021
Marcel Taeumel uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-mt.3069.mcz
==================== Summary ====================
Name: VMMaker.oscog-mt.3069
Author: mt
Time: 16 September 2021, 10:44:10.69532 am
UUID: 0075c4c3-a735-c943-8d63-bc6029d8afb4
Ancestors: VMMaker.oscog-eem.3068
Revert range check for coercing external data to only reach into signed 8-bit char type. In the future, there is no need to have signed character types here. This one remains for now for backwards compatibility in plugin version 1.
=============== Diff against VMMaker.oscog-eem.3068 ===============
Item was changed:
----- Method: ThreadedFFIPlugin>>ffiValidateExternalData:AtomicType: (in category 'callout support') -----
ffiValidateExternalData: oop AtomicType: atomicType
"Validate if the given oop (an instance of ExternalData) can be passed as a pointer to the given atomic type."
| ptrType specOop spec specType |
<inline: true>
ptrType := interpreterProxy fetchPointer: 1 ofObject: oop.
((interpreterProxy isPointers: ptrType)
and: [(interpreterProxy slotSizeOf: ptrType) >= 2]) ifFalse:
[^FFIErrorWrongType].
specOop := interpreterProxy fetchPointer: 0 ofObject: ptrType.
((interpreterProxy isWords: specOop)
and: [(interpreterProxy slotSizeOf: specOop) > 0]) ifFalse:
[^FFIErrorWrongType].
spec := interpreterProxy fetchPointer: 0 ofObject: specOop.
(self isAtomicType: spec) ifFalse:
[^FFIErrorWrongType].
specType := self atomicTypeOf: spec.
specType ~= atomicType ifTrue:
"Allow for signed/unsigned conversion but nothing else.
See FFIConstants class>>#initializeTypeConstants"
[(atomicType >= FFITypeUnsignedInt8
+ and: [atomicType <= FFITypeSignedChar8
- and: [atomicType <= FFITypeSignedChar32
and: [(atomicType >> 1) = (specType >> 1)]]) ifFalse:
[^FFIErrorCoercionFailed]].
^0!
More information about the Vm-dev
mailing list