> The method used in line 611 is in a different class:
> 267:Agent *Cell::getVegAgent(spcid id) const {
> 268: Agent *pAgent = NULL;
> 269: if (id < NUM_VEG) {
> 270: pAgent = m_apVegetation[id];
> 271: }
> 272: // this is to check for uninitialized
> 273: if (pAgent == NULL) {
> 274: pAgent = NULL;
> 275: }
> 276: return pAgent;
> 277:}
>
> When i run my application with valgrind, the first error to appear is:
> ==16915== Conditional jump or move depends on uninitialised value(s)
> ==16915== at 0x815A0ED:
> AgentPacker::updateVegiAgentFromArray2(float*, Population const*,
> unsigned int) (AgentPacker.cpp:613)
>
> I inserted various if-statem,ents in the code above to "catch"
> uninitialized variables,
> but the ' if (pAgent != NULL) {' is the only one that triggers a
> 'Conditional jump ..' message from valgrind.
> It looks like pAgent goes uninitialized between return statement line
> 276 in the second class and
> the call in line 611.
I would guess m_apVegetation[id] is uninitialised.
Try --track-origins=yes for Valgrind. That might help show
where the root cause of the problem is.
J
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users