Skip to content
This repository was archived by the owner on Nov 10, 2018. It is now read-only.
This repository was archived by the owner on Nov 10, 2018. It is now read-only.

Table marshalling duplicates objects that are referred to by multiple tables #255

@Quenty

Description

@Quenty

ROBLOX's parser for remote functions and the DataStore cannot handle multiple pointers to the same object.

Repro

Run this on the server:

Instance.new("RemoteEvent", Workspace)

image

Run this on the client

local RE = Workspace:FindFirstChild("RemoteEvent")
RE.OnClientEvent:connect(function(X) for _, Item in pairs(X) do print(Item.Links[1]) end end)

image

Run this on the server:

local Link = {}
local DB = {{Name = "ItemA"; Links = {Link};};{Name = "ItemB"; Links = {Link};}}; 
local RE = Workspace.RemoteEvent RE:FireClient(game.Players.Player1, DB)

image

The code above creates a new RemoteEvent in Workspace, and connects an event on the client. ROBLOX's parser cannot handle the pointers and crashes ROBLOX studio (the client).

It creates two tables instead of pointing to the same one.

A slight modification to this code will create a crash.

local Link = {}
local DB = {{Name = "ItemA"; Links = {Link};};{Name = "ItemB"; Links = {Link};}}; 
DB[3] = {Name="ItemC";Links={DB[1]};};
local RE = Workspace.RemoteEvent RE:FireClient(game.Players.Player1, DB)

Which will actually make ROBLOX crash. This issue #132 dealt with this, but apparently it has come back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions