FFI: FFI-Kernel-mt.135.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FFI: FFI-Kernel-mt.135.mcz

commits-2
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.135.mcz

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

Name: FFI-Kernel-mt.135
Author: mt
Time: 6 May 2021, 6:08:39.437981 pm
UUID: 7983191d-5e85-ca45-8d1a-b2fa02060f31
Ancestors: FFI-Kernel-mt.134

Bugfixes:
- out-of-bounds check in byte-array read-writer (still under construction, though)
- !! access to signed bytes through external address !!

=============== Diff against FFI-Kernel-mt.134 ===============

Item was changed:
  ----- Method: ByteArrayReadWriter>>doesNotUnderstand: (in category 'system primitives') -----
  doesNotUnderstand: aMessage
 
  | selector args |
  selector := aMessage selector.
  args := aMessage arguments.
  args size caseOf: {
  [ 1 ] -> [ (selector endsWith: 'At:') ifTrue: [ args at: 1 put: args first  + byteOffset ] ].
  [ 2 ] -> [ (selector endsWith: 'length:')
  ifTrue: [
  args at: 1 put: args first + byteOffset.
+ (args first + args second - 1) > (byteOffset + byteSize)
+ ifTrue: [self errorSubscriptBounds: args first + args second - 1] ]
- (args first + args second - 1) > byteSize
- ifTrue: [self errorSubscriptBounds: args first + args second] ]
  ifFalse: [(selector endsWith: 'put:') ifTrue: [
  args at: 1 put: args first + byteOffset ]] ].
  [ 3 ] -> [ (selector endsWith: 'length:')
  ifTrue: [
  args at: 1 put: args first + byteOffset.
+ (args first + args third - 1) > (byteSize + byteSize)
+ ifTrue: [self errorSubscriptBounds: args first + args third - 1]]]
- (args first + args third - 1) > byteSize
- ifTrue: [self errorSubscriptBounds: args first + args third]]]
  } otherwise: [].
  ^ aMessage sendTo: byteArray!

Item was changed:
  ----- Method: ExternalAddress>>byteAt: (in category 'accessing') -----
  byteAt: byteOffset
+ "Overwritten to to through a different primitive since the receiver describes data in the outside world."
+
+ ^ self integerAt: byteOffset size: 1 signed: false!
- "Go through a different primitive since the receiver describes data in the outside world"
- ^self unsignedByteAt: byteOffset!

Item was changed:
  ----- Method: ExternalAddress>>byteAt:put: (in category 'accessing') -----
  byteAt: byteOffset put: value
+ "Overwritten to go through a different primitive since the receiver describes data in the outside world."
+
+ ^ self integerAt: byteOffset put: value size: 1 signed: false!
- "Go through a different primitive since the receiver describes data in the outside world"
- ^self unsignedByteAt: byteOffset put: value!

Item was added:
+ ----- Method: ExternalAddress>>signedByteAt: (in category 'accessing') -----
+ signedByteAt: byteOffset
+ "Overwritten to go through a different primitive since the receiver describes data in the outside world."
+
+ ^ self integerAt: byteOffset size: 1 signed: true!

Item was added:
+ ----- Method: ExternalAddress>>signedByteAt:put: (in category 'accessing') -----
+ signedByteAt: byteOffset put: value
+ "Overwritten to go through a different primitive since the receiver describes data in the outside world."
+
+ ^ self integerAt: byteOffset put: value size: 1 signed: true!