← 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()

 

Fixed in r1894:

Yade [6]: Material().dispIndex
 ->  [6]: -1
Yade [7]: Material().dispHierarchy()
 ->  [7]: ['Material']

If getBaseClassIndex is called in the top-level indexable, it throws

  std::logic_error("Class " #SomeClass " should not have called
createIndex() in its ctor (since it is a top-level indexable, using
REGISTER_INDEX_COUNTER");

(explicit enough)

** Changed in: yade
       Status: Confirmed => Fix Released

-- 
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: Fix Released

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