Skip to content
Snippets Groups Projects
Commit eb779eef authored by scott snyder's avatar scott snyder
Browse files

Fix const bug in SG::ConstIterator.

SG::ConstIterator was using a non-const dereference on the underlying
DataHandle, causing it to return null if the referenced object was locked.
This was leading to ubsan warnings in ControlTest.

Former-commit-id: addd0611c8523a479d8b865e12490124ed0492b3
parent f06e9443
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -35,6 +35,11 @@ namespace detail {
return m_dh == rhs.m_dh;
}
DATA& deref() const { return *m_dh; }
const DATA& const_deref() const
{
const DataHandle<DATA>& dh = m_dh;
return *dh;
}
public:
/// @name SG-specific accessors
......@@ -85,7 +90,7 @@ namespace detail {
return detail::DHIteratorBase<DATA>::eql(rhs);
}
const DATA& dereference() const {
return detail::DHIteratorBase<DATA>::deref();
return detail::DHIteratorBase<DATA>::const_deref();
}
//@}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment