Skip to content

Commit

Permalink
exportvar: Fail when encountering a C function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Dec 2, 2023
1 parent 053e0d9 commit dfb2aa9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lbaselib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ static void luaB_dumpvar_impl (lua_State *L, int indents, Table *recursion_marke
luaL_pushresult(&b);
return;
}
else if (is_export)
luaL_error(L, "Can't export C function");
luaL_tolstring(L, -1, NULL);
return;
}
Expand All @@ -659,7 +661,7 @@ static void luaB_dumpvar_impl (lua_State *L, int indents, Table *recursion_marke
}
if (indents != 1 && hvalue(index2value(L, -1)) == recursion_marker) {
if (is_export) {
luaL_error(L, "exportvar does not handle recursion");
luaL_error(L, "Can't export recursive table");
}
lua_pushstring(L, "*RECURSION*");
return;
Expand Down

0 comments on commit dfb2aa9

Please sign in to comment.