Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Lua errors in bootstrap scripts fatal #9453

Merged
merged 5 commits into from Mar 23, 2022
Merged

Conversation

cuavas
Copy link
Member

@cuavas cuavas commented Mar 22, 2022

  • Made auto-boot script errors and plugin bootstrap errors fatal.
  • Run auto-boot scripts in a sandbox. Globals can be accessed, but not set. The sandbox is cleared on hard reset, but not on soft reset.
  • Added a (hopefully) useful to string metafunction to device_t that shows the short name and tag.
  • Fixed some issues in plugins that surface when strict type checking is enabled, as this means numbers and nil are not automatically converted to strings. Plugins should be tested with debug builds to check for this.
  • Changed some more function bindings to use set_function to avoid issues related to Wrong function gets called when registering table with lambdas ThePhD/sol2#608, and got rid of some unnecessary lambda captures.

The first change is something @galibert requested. This involved exposing some lower-evel helpers on the Lua engine class.

cuavas and others added 5 commits March 23, 2022 03:01
Made auto-boot script errors and plugin bootstrap errors fatal.

Run auto-boot scripts in a sandbox.  Globals can be accessed, but not
set.  The sandbox is cleared on hard reset, but not on soft reset.

Added a (hopefully) useful to string metafunction to device_t that shows
the short name and tag.

Fixed issues in plugins that surface when strict type checking is
enabled, as this means numbers and nil are not automatically converted
to strings.  Plugins should be tested with debug builds to check for
this.

Changed some more function bindings to use set_function to avoid issues
related to ThePhD/sol2#608, and got rid of some unnecessary lambda
captures.
Removed some unnecessary lambda captures.

Added a to string helper for address spaces.

Fixed machine:popmessage() with no arguments properly.

Made save item read_block raise an error on invalid arguments rather
than returning an empty string, and made it use luaL_buffer directly
rather than using the helper wrapper.

Changed a few more bindings to use set_function.
@cuavas cuavas merged commit e658848 into mamedev:master Mar 23, 2022
@cuavas cuavas deleted the luafatal branch March 23, 2022 09:28
wilbertpol pushed a commit to wilbertpol/mame that referenced this pull request Apr 22, 2022
Made auto-boot script errors and plugin bootstrap errors fatal.

Run auto-boot scripts in a sandbox.  Globals can be accessed, but not
set.  The sandbox is cleared on hard reset, but not on soft reset.

Added (hopefully) useful to string metafunctions to device_t and
address space that show short names and tags.

Fixed issues in plugins that surface when strict type checking is
enabled, as this means numbers and nil are not automatically converted
to strings.  Plugins should be tested with debug builds to check for
this.

Made save item read_block raise an error on invalid arguments rather
than returning an empty string, and made it use luaL_buffer directly
rather than using the helper wrapper.

Changed some more function bindings to use set_function to avoid issues
related to ThePhD/sol2#608, and got rid of some unnecessary lambda
captures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant