← Back to team overview

yade-dev team mailing list archive

[Bug 495437] Re: crash querying base class indices, if the top-level indexable did a createIndex()

 

Even if it is documented, calling classIndices on a top-level Indexable
throws:

Yade [1]: Material().baseIndices
terminate called without an active exception

At least it should throw a runtime_error (or type_error) with an
explanation, which can be trapped by boost::python instead of crashing.

-- 
crash querying base class indices, if the top-level indexable did a createIndex()
https://bugs.launchpad.net/bugs/495437
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.

Status in Yet Another Dynamic Engine: Confirmed

Bug description:
Material used to call both REGISTER_INDEX_COUNTER(Material) and called createIndex() in the constructor. The Indexable::getBaseClassIndex however relies on the fact the that top-level Indexable (Material, Shape, InteractionGeometry, InteractionPhysics) has negative index (default), which is violated by createIndex().

it can be fixed by requiring that top-level indexables don't use createIndex(), but it must be documented somewhere.





References