Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit ddd6e75

Browse files
committed
[[ Bug 20519 ]] Ensure handler return value survives trampoline
1 parent c2c7766 commit ddd6e75

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

docs/notes/bugfix-20519.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Prevent android native field widget crash on ime action

libfoundation/src/foundation-handler.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct MCHandlerInvokeTrampolineContext
6464
MCHandlerRef self;
6565
MCValueRef *p_arguments;
6666
uindex_t p_argument_count;
67-
MCValueRef r_value;
67+
MCValueRef& r_value;
6868
bool return_value;
6969
};
7070

@@ -98,10 +98,7 @@ bool MCHandlerExternalInvoke(MCHandlerRef self, MCValueRef *p_arguments, uindex_
9898
return t_context.return_value;
9999
}
100100
#endif
101-
102-
__MCAssertIsHandler(self);
103-
MCAssert(p_arguments != nil || p_argument_count == 0);
104-
return self -> callbacks -> invoke(MCHandlerGetContext(self), p_arguments, p_argument_count, r_value);
101+
return MCHandlerInvoke(self, p_arguments, p_argument_count, r_value);
105102
}
106103

107104
MC_DLLEXPORT_DEF

0 commit comments

Comments
 (0)