Ticket #41 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Bug accessing internals of Python long

Reported by: casevh@… Owned by: somebody
Priority: critical Milestone: 0.9.8.1
Component: Code Generation Keywords: MESSAGE
Cc: Quatre, Bornes

Description

I am trying to access the internal structure of a Python long. The code fragment below works when I use Pyrex 0.9.8.4 but generates a compile error when using Cython 0.9.8.


The code:

cdef extern from "Python.h":

ctypedef struct PyTypeObject?:

pass

ctypedef struct PyObject?:

Py_ssize_t ob_refcnt PyTypeObject? * ob_type

cdef extern from "longintrepr.h":

cdef struct _longobject:

int ob_refcnt PyTypeObject? * ob_type int ob_size unsigned int * ob_digit

def test(temp = long(0)):

cdef _longobject *l l = <_longobject *> temp print sizeof(l.ob_size) print sizeof(l.ob_digit[0])

Change History

Changed 6 years ago by robertwb

  • priority changed from major to critical

Changed 6 years ago by robertwb

This is due to #51

Changed 6 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed

Changed 6 years ago by robertwb

  • milestone set to 0.9.8.1

Changed 6 years ago by SRJamess

  • cc Quatre, Bornes added
  • keywords MESSAGE added

broadway music indiana merriville <a href= http://chiara-civello.meh6.co.cc/map.html>hawaiian styles of music </a>

<a href= http://throneum.gretpol.co.cc/map.html> carman free music download</a>  http://n-sync.allorg.co.cc/map.html instamental song music

 http://retro---various-artists.umehon.co.cc/map.html music metre cabal  http://bethlehem.meh6.co.cc/map.html york pa live music

Note: See TracTickets for help on using tickets.