diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 77ddd1671..e64521734 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -313,8 +313,8 @@ struct _stack template remove_cref_t & top(int i = 0) const { - return *reinterpret_cast( - reinterpret_cast*>(data) + i ); + void * data_n = reinterpret_cast*>(data) + i; + return *reinterpret_cast( data_n ); } // Get a pointer to the last A-th item skipping over any A pre i-th items. @@ -339,7 +339,7 @@ struct _stack remove_cref_t pop() { using U = remove_cref_t; - U result = std::move(top()); + U result( top() ); pop( 1 ); return result; } @@ -350,7 +350,8 @@ struct _stack { using U = remove_cref_t; check_alignment(); - data = reinterpret_cast( data ) + n; + U* u = reinterpret_cast( data ); + data = u + n; check_alignment(); --cleanups_size; }