[Commits] [wesnoth/wesnoth] 29e93d: Respect lua_next constraints

GitHub noreply at github.com
Fri Nov 10 01:46:13 UTC 2017


  Branch: refs/heads/GL_lua_next
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 29e93dabcafda8ce16471e2c0ed930251003c4c3
      https://github.com/wesnoth/wesnoth/commit/29e93dabcafda8ce16471e2c0ed930251003c4c3
  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: 89753bfda2cf419891786c753b06ad6705696d84
      https://github.com/wesnoth/wesnoth/commit/89753bfda2cf419891786c753b06ad6705696d84
  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/dbbbba7ad3f2...89753bfda2cf


More information about the Commits mailing list