[Commits] [wesnoth/wesnoth] 7f98de: Respect lua_next constraints

GitHub noreply at github.com
Fri Nov 10 02:38:12 UTC 2017


  Branch: refs/heads/GL_lua_next
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 7f98defccde2d335644342d8ef2336447552974e
      https://github.com/wesnoth/wesnoth/commit/7f98defccde2d335644342d8ef2336447552974e
  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: 858240862d1b095546c8c026b29e7181f9ac1bb7
      https://github.com/wesnoth/wesnoth/commit/858240862d1b095546c8c026b29e7181f9ac1bb7
  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/89753bfda2cf...858240862d1b


More information about the Commits mailing list