codon
codon copied to clipboard
Segmentation fault is caused with pyext mode when a method takes an object of another class as input
Hi, thank you for maintaining this fantastic software.
I found that the following codon code compiled with -pyext
:
@dataclass(python=True, repr=True)
class Foo:
a: float
@dataclass(python=True, repr=True)
class Bar:
def func(self, foo: Foo):
print(foo)
def func(foo: Foo):
print(foo)
can cause segmentation fault by the following Python code
from codon_module import Foo, Bar
Bar().func(Foo())
I also found the following code properly works:
from codon_module import Foo, func
func(Foo())
I now also got the following new finding.
In my environment, the following codon code with the Python code Bar().func(Foo())
outputs 0
(, which might be NULL...?)
@dataclass(python=True, repr=True)
class Bar:
def func(self, foo: Foo):
print(id(foo))