Commit 6a3b9698 authored by Michael Jarrett's avatar Michael Jarrett

Adding comment to warn of the potential segfault in gcc.

parent eb02361e
...@@ -340,6 +340,8 @@ template <class T> ...@@ -340,6 +340,8 @@ template <class T>
static const std::shared_ptr<T> & objectFromHandleAddress(jlong handle) { static const std::shared_ptr<T> & objectFromHandleAddress(jlong handle) {
assert(handle); assert(handle);
assert(handle > 4096); assert(handle > 4096);
// Below line segfaults gcc-4.8. Using a temporary variable hides the bug.
//const auto & ret = reinterpret_cast<const CppProxyHandle<T> *>(handle)->get();
const CppProxyHandle<T> *temp = reinterpret_cast<const CppProxyHandle<T> *>(handle); const CppProxyHandle<T> *temp = reinterpret_cast<const CppProxyHandle<T> *>(handle);
const auto & ret = temp->get(); const auto & ret = temp->get();
assert(ret); assert(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment