cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
17 stars 21 forks source link

segfault in model->flatten() #589

Open kerimoyle opened 4 years ago

kerimoyle commented 4 years ago

I'm not sure whether this is a "feature" or a "bug" ... but a call to flatten a model which contains encapsulated imports fails. If you flatten first, then import the child components, it's fine. Either way, a warning rather than a segfault would be good ...?

import membrane component 
model -> add membrane component

import potassium channel 
membrane ->add potassium channel

model ->flatten *** segfaults

BUT

import membrane component 
model -> add membrane component
model ->flatten
membrane = model -> component called membrane

import potassium channel 
membrane ->add potassium channel

model ->flatten  *** fine :)
hsorby commented 4 years ago

I think I can see what you are saying but it would be easier with a test :)

kerimoyle commented 4 years ago

Gah, just tried it with two simple tests ... and no segfault ... I guess it's a trickier one ...

hsorby commented 4 years ago

I love tests, I feel liked I have solved the segfault.