Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Lua global "load" still accepts bytecode #182

@hce

Description

@hce

As I understand it, LuaContext's load function only accepts source code to ensure rust's safety semantics cannot be violated by a potentially unpredictable/(faulty behaving when presented with specially crafted input) C function.

  • Looks like from Lua itself, the global "load" function still accepts bytecode.

  • For a project of mine, I compile Lua scripts to bytecode, embed them in the project, and then load them back. Circumventing that limitation by tapping into globals() and retrieving the load function from there.

-> I think the ability to load bytecode should be removed from Lua globals, and maybe string.dump as well.
-> But, to compensate for that loss, I think both functions should be exposed to the rust API as unsafe {} calls?

Do you agree? If yes, I could submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions