Getting Assertion Failed error when debugging Lua script

100 views Asked by At

I have the following simple script, where I first require the lib which I have implemented on the C++ side. The latter has a MyData class defined with an API method GetNumPoints that returns the size of the data points stored in the class (the first input arg in the constructor, and the second arg is the number of points).

In the below Lua script if I have the SomeMethod() call commented out then it runs through and the output is "userdata (2)". But as soon as I remove the comments and run even the empty method in the script then I get the error seen in the attached image. Any idea what's happening here?

require "SciApiLuaExtLib"

local myData = MyData({0.1, 0.2}, 2)
print(type(myData) .. " (" .. myData:GetNumPoints() .. ")")

function SomeMethod()
end

--SomeMethod()

By the way on line 127 of the namespace.h file (as seen in the attached image) of the Lua Bridge there is the following C++ line:

assert (lua_isuserdata (L, 1)); // warn on security bypass

I use ZeroBrane for debugging (if that helps anyhow).

enter image description here

0

There are 0 answers