Skip to content

Commit

Permalink
Merge pull request #2697 from endrift/fix-jit-trampoline
Browse files Browse the repository at this point in the history
Common: CallLambdaTrampoline can return a value
  • Loading branch information
Tilka committed Jul 4, 2015
2 parents eb3c5a2 + c9a25f9 commit 3bbb2ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Source/Core/Common/Arm64Emitter.h
Expand Up @@ -711,10 +711,9 @@ class ARM64XEmitter
// (this method might be a thunk in the case of multi-inheritance) so we
// have to go through a trampoline function.
template <typename T, typename... Args>
static void CallLambdaTrampoline(const std::function<T(Args...)>* f,
Args... args)
static T CallLambdaTrampoline(const std::function<T(Args...)>* f, Args... args)
{
(*f)(args...);
return (*f)(args...);
}

// This function expects you to have set up the state.
Expand Down
5 changes: 2 additions & 3 deletions Source/Core/Common/x64Emitter.h
Expand Up @@ -971,10 +971,9 @@ class XEmitter
// (this method might be a thunk in the case of multi-inheritance) so we
// have to go through a trampoline function.
template <typename T, typename... Args>
static void CallLambdaTrampoline(const std::function<T(Args...)>* f,
Args... args)
static T CallLambdaTrampoline(const std::function<T(Args...)>* f, Args... args)
{
(*f)(args...);
return (*f)(args...);
}

template <typename T, typename... Args>
Expand Down

0 comments on commit 3bbb2ed

Please sign in to comment.