lua-users home
lua-l archive

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


I had the need to protect globals / environment from modification by
code - not for security, merely for correctness and convenience, so
not a proper sandbox, and I found this to be a common request judging
by the amount of search results spanning over a decade, but no
high-performance solutions existed AFAIK up till Lua 5.4

I attempted a modification allowing an enable / disable bit for
OP_SETTABUP controlled by a C API, and the overhead in my use case was
negligible and it covered all the situations I'm interested in. A
patch is attached.

Is there interest in mainlining this feature? I wouldn't mind
maintaining a local fork with this applied for my needs, but I think
the widespread interest in this problem might make it viable. I am not
sure, however, how this fits into the bigger picture with such a
widely used library.

Looking forward to some opinions.

- S

Attachment: 0001-Added-upvalue-protection-API.patch
Description: Binary data