enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-devel] Lua 5.1 "luaL_error" problems on Windows


From: Ronald Lamprecht
Subject: [Enigma-devel] Lua 5.1 "luaL_error" problems on Windows
Date: Fri, 23 Jun 2006 22:23:58 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Hi,

Some functions supplied by lua.cc crash on calling "luaL_error":

- enigma.GetAttrib with non existing attribute or pseudo-attribute "kind".
- enigma.GetKind(nil)

These crashes occur only on Windows but not on Linux. They are independent of Lua 5.1 and 5.1.1.

The error handling does work in general on Windows, as incorrect calls like

enigma.SetItem(7,9, nil)

are reported correctly.

Please find attached a sample level with the different errors commented out. Activate one after the other for testing.

Any ideas?

BTW calling enigma.GetAttrib with a non existing attribute will always end in a level abortion as "luaL_error" will never return. Shouldn't we skip this error message to return "nil" as prepared in lua.cc? At least Andreas and I did expect nil for non existing attributes as we have no other function to test the existance of an attribute.

- Ronald
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" 
xmlns:el="http://enigma-game.org/schema/level/1";>
  <el:protected >
    <el:info el:type="level">
      <el:identity el:title="Test luaL_error" el:id="20060623ralt007"/>
      <el:version el:score="0" el:release="0" el:revision="1" 
el:status="experimental"/>
      <el:author  el:name="Ronald Lamprecht"/>
      <el:copyright>Copyright © 2006 Ronald Lamprecht</el:copyright>
      <el:license el:type="GPL2" el:open="true">GPL v2.0 or above</el:license>
      <el:compatibility el:enigma="0.92"/>
      <el:modes el:easy="false" el:single="true" el:network="false"/>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
levelw = 20
levelh = 13

create_world( levelw, levelh)
draw_border("st-wood")
fill_floor("fl-leavesb", 0,0,levelw,levelh)

oxyd( 4,4)
oxyd( 14,4)

set_actor("ac-blackball", 4, 11)

set_stone("st-switch", 5, 11, {action="callback", target="test"})
switch = enigma.GetStone(5,11)

-- enigma.SetItem(7,9, nil)
-- enigma.GetKind(nil)
-- enigma.GetAttrib(sender, "notexisting")

function test(onoff, sender)
--    enigma.SetItem(7,9, nil)
--    enigma.GetKind(nil)
--    enigma.GetAttrib(sender, "notexisting")
end
    ]]></el:luamain>
    <el:i18n/>
  </el:protected>
</el:level>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]