|
![]() |
#1 |
Knight
Join Date: Jan 2008
Posts: 926
![]() |
T2: fine in 32-bit, Lua error in 64-bit
I've noticed that (in ToME 2.3.5) hitting escape in the Geomancy spell menu produces a Lua error on 64-bit Linux. The error indicates that the game attempted to index a nil variable in the function get_affect() in lib/core/s_aux.lua. It's not fatal, but it is quite unsightly.
What's weird is that the 32-bit Linux version is perfectly okay. (2.3.9-ah also doesn't have this issue.) Anyone know why an error like this might occur only in 64-bit mode? |
![]() |
![]() |
![]() |
#2 |
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
It may be that a function prototype/declaration in the *.pkg file differs from the declaration in the *.h file.
|
![]() |
![]() |
![]() |
#3 |
Knight
Join Date: Jan 2008
Posts: 926
![]() |
Thanks...
Looking at the stack traceback, BTW, it looks to me like cast_school_spell() is being invoked even when you hit the escape key - and thus invoked on a spell that doesn't exist, producing the error. Not sure why; escape is supposed to produce a value of -1, which should be caught by an if statement and cause cast_school_spell not to be invoked: Code:
s = get_school_spell("cast", "is_ok_spell", 63) if (s ~= -1) then cast_school_spell(s, spell(s)) end |
![]() |
![]() |
![]() |
#4 |
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
It's probably a declaration mismatch on the return of the function then. -1 in two-completement in 32-bit has a tendency to not stay -1 when "converted" (without sign extension, or a random adjacent garbage)
|
![]() |
![]() |
![]() |
#5 |
Knight
Join Date: Jan 2008
Posts: 926
![]() |
Looks like you're right, it's a u32b getting converted to an int. Thank you.
Edit: wait, u32b? How are we supposed to get -1 with an unsigned integer? Edit 2: yes, making get_school_spell return an int instead of a u32b worked. Hurray. Last edited by Therem Harth; October 24, 2012 at 19:05. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bit of advice? | Leiferra | Vanilla | 7 | August 26, 2011 06:08 |
Unused monster bit flags? | Hajo | Development | 2 | August 28, 2010 10:47 |
Game crash - 3.1.2 Win 7 64 bit | kurie | Vanilla | 4 | February 23, 2010 02:37 |
Something a bit different | Aknight | Variants | 22 | June 25, 2008 21:13 |
Will we get rid of the 32 bit flag variables? | Bandobras | Vanilla | 18 | December 22, 2007 14:54 |