Skip to content

Instantly share code, notes, and snippets.

@slashkeyvalue
Last active June 10, 2022 16:38
Show Gist options
  • Save slashkeyvalue/00102154fb6bcd7c69aeb4559468a4dd to your computer and use it in GitHub Desktop.
Save slashkeyvalue/00102154fb6bcd7c69aeb4559468a4dd to your computer and use it in GitHub Desktop.
repro: 'attempt to yield across a C-call boundary'
global.exports('forceCcallException', async () =>
{
await new Promise(resolve =>
{
setImmediate(() =>
{
resolve(true);
})
});
return [ 1 ];
});
CreateThread(function()
local EXT = 100
msgpack.extend_clear(EXT)
local t = setmetatable({ },
{
__pairs = function(t)
local values = exports['dependency']:forceCcallException()
return next, values, nil
end,
__ext = EXT,
__pack = function(t, tag)
for _, v in pairs(t) do
end
end,
__unpack = function(data, tag)
end,
})
for _, v in pairs(t) do
-- Works
end
TriggerEvent('any', t) -- Fails, __pack is invoked
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment