fix lua::create_lambda
This commit is contained in:
parent
b8944f86c6
commit
40cdebb175
@ -270,12 +270,13 @@ scripting::common_func lua::create_lambda(State* L) {
|
||||
return [=](const std::vector<dv::value>& args) -> dv::value {
|
||||
if (!get_from(L, LAMBDAS_TABLE, *funcptr, false))
|
||||
return nullptr;
|
||||
int top = gettop(L) + 1;
|
||||
int top = gettop(L) - 1;
|
||||
for (const auto& arg : args) {
|
||||
pushvalue(L, arg);
|
||||
}
|
||||
if (call(L, args.size(), 1)) {
|
||||
int nres = gettop(L) - top;
|
||||
assert(nres >= 0);
|
||||
if (nres) {
|
||||
auto result = tovalue(L, -1);
|
||||
pop(L, 1 + nres);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user