Re: luaL_checkudata different behavior from standard lua

  • From: Ryan Gonzalez <rymg19@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx,Ivan Solis <ivansolispadilla@xxxxxxxxx>
  • Date: Fri, 25 Sep 2015 12:24:21 -0500



On September 25, 2015 12:16:15 PM CDT, Ivan Solis <ivansolispadilla@xxxxxxxxx>
wrote:

Hi,

I am using luars232 library which works fine on standard lua. When
using
luajit I get this error calling about any function:

bad argument #1 to 'set_baud_rate' (luars232 expected, got userdata)

I have checked the mail list, faq, etc and haven't found an answer.

This is the lua code:

err, static_port = rs232.open("COM1")
assert(err == rs232.RS232_ERR_NOERROR, "Couldn't open serial port:
COM1\n")
static_port.set_baud_rate(static_port, baud)

Looking at the library, they call luaL_checkudata to validate the first
function parameter:

struct rs232_port_t *p = (struct rs232_port_t*) luaL_checkudata(L, 1,
"luars232");

So, what changed in luajit for the luaL_checkudata function? Is there
an
easy way around it?

I'm happy to try and fix it, if a fix is needed and I get some
**pointers**.


0xAB997450
0xDEADBEEF
0xC2A934FF

:D

Regards!
Ivan

--
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.

Other related posts: