[Commits] [wesnoth/wesnoth] dd7c23: Respect lua_next constraints

GitHub noreply at github.com
Thu Nov 9 22:53:46 UTC 2017


  Branch: refs/heads/GL_lua_next
  Home:   https://github.com/wesnoth/wesnoth
  Commit: dd7c233ae089c270666f9a85f9721ff9a22b432b
      https://github.com/wesnoth/wesnoth/commit/dd7c233ae089c270666f9a85f9721ff9a22b432b
  Author: Gregory A Lundberg <gregory_lundberg at gmx.com>
  Date:   2017-11-09 (Thu, 09 Nov 2017)

  Changed paths:
    M src/scripting/lua_common.cpp
    M src/scripting/lua_formula_bridge.cpp
    M src/scripting/lua_kernel_base.cpp

  Log Message:
  -----------
  Respect lua_next constraints

The key value returned by lua_next, on the Lua stack, cannot be modified.

Certain tests such as lua_isstring will convert the value.

The solution is, instead of testing if they key can be converted to a string, test if it actually is a string by using lua_type.


  Commit: dbbbba7ad3f21b77c167b7ca542507a5c920fb4b
      https://github.com/wesnoth/wesnoth/commit/dbbbba7ad3f21b77c167b7ca542507a5c920fb4b
  Author: Gregory A Lundberg <gregory_lundberg at gmx.com>
  Date:   2017-11-09 (Thu, 09 Nov 2017)

  Changed paths:
    M src/scripting/lua_kernel_base.cpp

  Log Message:
  -----------
  Do not lua_next on userdata.

Ever.
Really.
YOU HAVE BEEN WARNED!

Closes #2171


Compare: https://github.com/wesnoth/wesnoth/compare/2be2a519732a...dbbbba7ad3f2


More information about the Commits mailing list