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

GitHub noreply at github.com
Tue Nov 7 22:41:21 UTC 2017


  Branch: refs/heads/GL_lua_next
  Home:   https://github.com/wesnoth/wesnoth
  Commit: fbfc673d1b3f807b7e5ec4b37e90b125c9474126
      https://github.com/wesnoth/wesnoth/commit/fbfc673d1b3f807b7e5ec4b37e90b125c9474126
  Author: Gregory A Lundberg <gregory_lundberg at gmx.com>
  Date:   2017-11-07 (Tue, 07 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.

This closes #2171





More information about the Commits mailing list