Skip to content

Crashes when converting tables to Variant #154

@gilzoide

Description

@gilzoide

Hi! I’m new to Godot and still learning how to use lua-gdextension.
While experimenting, I noticed some strange crashes and I’m not sure if this is expected behavior or a bug.

local player = {
    extends = Node2D,
}

-- Case 1: Lua tables inside Array
function player:test1()
    local array1 = {}
    local array2 = {}
    return Array{array1, array2} -- segfault
end

-- Case 2: Multiple return values
function player:test2()
    return {}, 1 -- segfault
end

function player:_process(dt)
    self:test1()
    self:test2()
end

return player

What I observed
return Array{{}} → segfault
return {}, 1 → segfault
return {} → does not crash
return Array{1, 2, 3} → works fine

Is this the correct/expected behavior (Lua tables not allowed, only Godot-native types)?
Or should this raise an error instead of crashing?

Originally posted by @modcos in #153

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions