lua-users home
lua-l archive

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


On 9/03/2010, at 4:41 PM, Mike Pall wrote:
> Geoff Leyland wrote:
>> Sorry for such a vague report, and it's most likely I'm
>> depending on undefined behavior somewhere, but since I'm having
>> trouble working this out, do you have any ideas what this might
>> be?  Any ideas what changes a print statement might cause or
>> what undefined behavior has changed since beta2?
> 
> If the compiler encounters a print(), it aborts the current trace,
> i.e. it doesn't compile that piece of code. Try io.write instead
> (which is compiled in beta3).

Thanks Mike!

Getting rid of the prints and putting the line 

    local io, tostring = io, tostring

at the top of the module where the problem seems to happen fixes it.  (I'm not io.writing anything anywhere, or calling tostring)

The lines

   local a, b = 1, 2

in the same place also fix it.  The lines

    --local a, b = 1, 2
    local a, b = 1, 2

do not fix the problem.

I'm not running any debug hook or luacov, I do have a version of strict.lua running, but turning on or off does not seem to have an effect.

I'm mystified, but still happy to believe it's my mistake.

Cheers,
Geoff