[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Question about debug.getupvalue
- From: "Alex Davies" <alex.mania@...>
- Date: Wed, 21 May 2008 17:26:16 +0800
I have got a question about debug.getupvalue :
why is it forbidden to get an upvalue value
from a C function in Lua ?
It's merely a security thing. Lua should not be able to modify a C functions
upvalues, which getupvalue would allow in the case of tables or userdata. Eg
the common case of having a metatable as an upvalue. You're right though,
for immutable types such as numbers and strings there'd be no danger.
There's no harm in writing your own getupvalue using the C API though.