Skip to content

Commit

Permalink
issue #198 WIP add api for marking a proto as var arg
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Aug 31, 2020
1 parent 0f698f3 commit 90a26a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ravi_complib.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ static lua_CFunction get_compiled_function(void* context, void* module, const ch
return (lua_CFunction)mir_get_func(ccontext->jit->jit, M, name);
}
static void lua_setProtoFunction(void* context, Proto* p, lua_CFunction func) { p->ravi_jit.jit_function = func; }
static void lua_setVarArg(void *context, Proto *p) { p->is_vararg = 1; }

static int load_and_compile(lua_State* L) {
const char* s = luaL_checkstring(L, 1);
Expand All @@ -189,6 +190,7 @@ static int load_and_compile(lua_State* L) {
.finish_C_compiler = finish_C_compiler,
.get_compiled_function = get_compiled_function,
.add_upvalue = add_upvalue,
.lua_setVarArg = lua_setVarArg,
.lua_setProtoFunction = lua_setProtoFunction};

int rc = raviX_compile(&ravicomp_interface);
Expand Down

0 comments on commit 90a26a4

Please sign in to comment.