lua-users home
lua-l archive

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


Wow, so i think i figured it out. I am using Decoda as my debugger and its the IDE that is giving the exception and gives an option to ignore the exceptions thrown, when i ignore them it seems to work as expected. I was just confused because i thought they were errors.


On Tue, Oct 5, 2010 at 10:42 AM, pedro <pedro@zbicajnik.com.ar> wrote:
ok
----- Original Message -----
Sent: Tuesday, October 05, 2010 2:18 PM
Subject: Re: Lua BitOp test file causes exception?

"Or have you compiled Lua as C++ code?
(not generally recommended)"


I am building it as C++  with my app's build process. could this be the cause of the problem? 

I will build it as C like the wiki says and see if that makes a difference. i notice there is a disclaimer about exceptions when building as C++

it shouldnt be that big of a deal for me to completely replace the lua source with a newer/fresh version if you think that may fix things. i believe the only thing i changed was for bitop anyways.




On Tue, Oct 5, 2010 at 9:54 AM, Mike Pall <mikelu-1010@mike.de> wrote:
Joe Andresen wrote:
> I tried those two lines and got the exact same error.

Then something is seriously broken in your copy of Lua or in
the way you embed it.

> I'm using lua source 5.1.4
>
> and latest bit op (source) version 1.0.1
>
> i am compiling with visual studio 2008.

That should work just fine. Have you compiled the sources using
the provided etc/luavs.bat? Or have you compiled Lua as C++ code?
(not generally recommended)

> I was sure to add the two chunks of code in the install part of the website
> and recompiled several times.

I'd always suggest to try it with the command line lua.exe first.

> the first couple of asserts work in the test code but the pcall's do not.
>
> i use pcall from c in other parts of code and it works fine.

Ok, but does it actually catch errors, too?

Since Lua's pcall() library function just calls into lua_pcall()
it would be a bit surprising to see a difference.

Perhaps something in your code is replacing the pcall() function?
E.g. there are broken versions of coxpcall out there.

Or have you installed an error handler (like debug.traceback)?
Note that the error handler must not throw an error itself or
abort the process in any way. It should only return a string.

> I'm pretty sure i havent changed the source in that sense....  the error
> says it is expecting a number not a string. Could it be that i missed
> something somewhere where the bitop functions are strings instead of
> numbers??

Nope, the error message you quoted is correct. Your problem has
little to do with Lua BitOp. You're just seeing a symptom in the
test cases. Error handling is part of the Lua core.

--Mike