lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Dear lua user,

When I tried to compile lua 5.0 with VisualC++6, I was confused by some code in ldo.c:

void luaD_reallocstack(lua_State * L, int newsize)
	TObject *oldstack = L->stack;
	luaM_reallocvector(L, L->stack, L->stacksize, newsize, TObject);
^^^^^^^^ I think oldstack(old L->stack) will be a Dangling Pointer
	L->stacksize = newsize;
	L->stack_last = L->stack + newsize - 1 - EXTRA_STACK;
	correctstack(L, oldstack);
		is oldstack a Dangling Pointer here ?

With best regards

        John Rayn

享用世界上最大的电子邮件系统― MSN Hotmail。