File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -452,7 +452,9 @@ export class PyObject {
452
452
}
453
453
return new PyObject ( list ) ;
454
454
} else if ( v instanceof Callback ) {
455
- const pyMethodDef = new Uint8Array ( 8 + 8 + 4 + 8 ) ;
455
+ // https://docs.python.org/3/c-api/structures.html#c.PyMethodDef
456
+ // there are extra 4 bytes of padding after ml_flags field
457
+ const pyMethodDef = new Uint8Array ( 8 + 8 + 4 + 4 + 8 ) ;
456
458
const view = new DataView ( pyMethodDef . buffer ) ;
457
459
const LE =
458
460
new Uint8Array ( new Uint32Array ( [ 0x12345678 ] ) . buffer ) [ 0 ] !== 0x7 ;
@@ -471,7 +473,7 @@ export class PyObject {
471
473
) ;
472
474
view . setInt32 ( 16 , 0x1 | 0x2 , LE ) ;
473
475
view . setBigUint64 (
474
- 20 ,
476
+ 24 ,
475
477
BigInt ( Deno . UnsafePointer . value ( Deno . UnsafePointer . of ( nameBuf ) ! ) ) ,
476
478
LE ,
477
479
) ;
You can’t perform that action at this time.
0 commit comments