From e78cf96c971234ea25e35a9672ef00ea389d843f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 24 Oct 1997 15:17:24 -0200 Subject: first version of Cclosures. --- lvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lvm.c') diff --git a/lvm.c b/lvm.c index 4b77c3a6..2f8aaea1 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 1.9 1997/10/13 22:12:04 roberto Exp roberto $ +** $Id: lvm.c,v 1.10 1997/10/16 10:59:34 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -79,8 +79,8 @@ int luaV_tostring (TObject *obj) void luaV_closure (int nelems) { Closure *c = luaF_newclosure(nelems); - memcpy(c->consts, luaD_stack.top-(nelems+1), (nelems+1)*sizeof(TObject)); - c->nelems = nelems; + c->consts[0] = *(luaD_stack.top-1); + memcpy(&c->consts[1], luaD_stack.top-(nelems+1), nelems*sizeof(TObject)); luaD_stack.top -= nelems; ttype(luaD_stack.top-1) = LUA_T_FUNCTION; (luaD_stack.top-1)->value.cl = c; -- cgit v1.2.3-55-g6feb