One of the Lua maintainers has recommended using "lua_pushglobaltable" to push the globals table, as being more future-proof than the method currently used by SWIG.
lua_pushglobaltable is new in Lua 5.2, so this patch:
(1) Adds a definition of lua_pushglobaltable for older versions of Lua to Lib/lua/luarun.swg
(2) Changes Lib/lua/luaruntime.swg to use it
With patch, the Lua test-suite results are unchanged for both Lua 5.1 and 5.2.
Use lua_pushglobaltable for Lua
Okay, committed for swig-2.0.5