Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2907.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2907 Author: eem Time: 22 December 2020, 4:32:46.670664 pm UUID: 5bf10ff3-9f29-4f07-b93a-91354783cb32 Ancestors: VMMaker.oscog-tpr.2906
Simulation: Fix regression in SocketPluginSimulator due to changes to CArray>>coerceTo:sim: in VMMaker.oscog-eem.2905; 'char *' is assumed to be unsigned. Add a missing Socket primitive simulation (hit when running the SocketTests under simulation). Add a useful error message to CLiteralArray>>at:put:
=============== Diff against VMMaker.oscog-tpr.2906 ===============
Item was changed: ----- Method: CArray>>coerceTo:sim: (in category 'converting') ----- coerceTo: cTypeString sim: interpreterSimulator
^cTypeString caseOf: { ['int'] -> [self ptrAddress]. ['float *'] -> [self asSingleFloatAccessor]. ['double *'] -> [self asDoubleFloatAccessor]. ['sqInt *'] -> [self shallowCopy unitSize: interpreter bytesPerOop; beSigned]. ['unsigned int *'] -> [self shallowCopy unitSize: 4; beUnsigned]. ['int *'] -> [self shallowCopy unitSize: 4; beSigned]. ['unsigned short *'] -> [self shallowCopy unitSize: 2; beUnsigned]. ['short *'] -> [self shallowCopy unitSize: 2; beSigned]. ['unsigned char *'] -> [self shallowCopy unitSize: 1; beUnsigned]. + ['char *'] -> [self shallowCopy unitSize: 1; beUnsigned]. "C is ambivalent on the issue; sigh... SocketPlugin assumes unsigned" - ['char *'] -> [self shallowCopy unitSize: 1; beSigned]. "C is ambivalent on the issue; sigh..." ['unsigned'] -> [self ptrAddress]. ['sqInt'] -> [self ptrAddress]. ['usqInt'] -> [self ptrAddress]. ['sqIntptr_t'] -> [self shallowCopy unitSize: interpreter bytesPerOop; yourself] }!
Item was changed: ----- Method: CLiteralArray>>at:put: (in category 'accessing') ----- at: offset put: val + self error: 'Literals are immutable; proceed to attempt to assign anyway...'. ^object at: offset + 1 put: val!
Item was added: + ----- Method: SocketPluginSimulator>>sqSocket:ListenOnPort:BacklogSize: (in category 'simulation') ----- + sqSocket: socketHandle ListenOnPort: portNumber BacklogSize: backlog + ^[Socket basicNew + primSocket: ((self hostSocketHandleFromSimSocketHandle: socketHandle) ifNil: [^self]) + listenOn: portNumber + backlogSize: backlog] + on: SocketPrimitiveFailed + do: [:ex| + interpreterProxy primitiveFail. + 0]!
Hi Eliot, IMO no C code should assume that char is signed nor unsigned... If socket plugin assumes unsigned, shouldn't it better use unsigned char* explicitelitely?
Le mer. 23 déc. 2020 à 01:33, commits@source.squeak.org a écrit :
Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2907.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2907 Author: eem Time: 22 December 2020, 4:32:46.670664 pm UUID: 5bf10ff3-9f29-4f07-b93a-91354783cb32 Ancestors: VMMaker.oscog-tpr.2906
Simulation: Fix regression in SocketPluginSimulator due to changes to CArray>>coerceTo:sim: in VMMaker.oscog-eem.2905; 'char *' is assumed to be unsigned. Add a missing Socket primitive simulation (hit when running the SocketTests under simulation). Add a useful error message to CLiteralArray>>at:put:
=============== Diff against VMMaker.oscog-tpr.2906 ===============
Item was changed: ----- Method: CArray>>coerceTo:sim: (in category 'converting') ----- coerceTo: cTypeString sim: interpreterSimulator
^cTypeString caseOf: { ['int'] -> [self ptrAddress]. ['float *'] -> [self
asSingleFloatAccessor]. ['double *'] -> [self asDoubleFloatAccessor]. ['sqInt *'] -> [self shallowCopy unitSize: interpreter bytesPerOop; beSigned]. ['unsigned int *'] -> [self shallowCopy unitSize: 4; beUnsigned]. ['int *'] -> [self shallowCopy unitSize: 4; beSigned]. ['unsigned short *'] -> [self shallowCopy unitSize: 2; beUnsigned]. ['short *'] -> [self shallowCopy unitSize: 2; beSigned]. ['unsigned char *'] -> [self shallowCopy unitSize: 1; beUnsigned].
['char *'] -> [self shallowCopy
unitSize: 1; beUnsigned]. "C is ambivalent on the issue; sigh... SocketPlugin assumes unsigned"
['char *'] -> [self shallowCopy
unitSize: 1; beSigned]. "C is ambivalent on the issue; sigh..." ['unsigned'] -> [self ptrAddress]. ['sqInt'] -> [self ptrAddress]. ['usqInt'] -> [self ptrAddress]. ['sqIntptr_t'] -> [self shallowCopy unitSize: interpreter bytesPerOop; yourself] }!
Item was changed: ----- Method: CLiteralArray>>at:put: (in category 'accessing') ----- at: offset put: val
self error: 'Literals are immutable; proceed to attempt to assign
anyway...'. ^object at: offset + 1 put: val!
Item was added:
- ----- Method: SocketPluginSimulator>>sqSocket:ListenOnPort:BacklogSize:
(in category 'simulation') -----
- sqSocket: socketHandle ListenOnPort: portNumber BacklogSize: backlog
^[Socket basicNew
primSocket: ((self
hostSocketHandleFromSimSocketHandle: socketHandle) ifNil: [^self])
listenOn: portNumber
backlogSize: backlog]
on: SocketPrimitiveFailed
do: [:ex|
interpreterProxy primitiveFail.
0]!
vm-dev@lists.squeakfoundation.org