Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store WorkItemID by a local variable #306

Open
WJsjtu opened this issue Jun 10, 2024 · 0 comments
Open

Store WorkItemID by a local variable #306

WJsjtu opened this issue Jun 10, 2024 · 0 comments

Comments

@WJsjtu
Copy link

WJsjtu commented Jun 10, 2024

FTOPWorkResult& WorkResult = InTOPNode->WorkResult[Index];
if (WorkResult.WorkItemID == INDEX_NONE || !WorkItemIDSet.Contains(WorkResult.WorkItemID))
{
HOUDINI_PDG_WARNING(
TEXT("Pruning a FTOPWorkResult entry from TOP Node %d, WorkItemID %d, WorkItemIndex %d, Array Index %d"),
InTOPNode->NodeId, WorkResult.WorkItemID, WorkResult.WorkItemIndex, Index);
WorkResult.ClearAndDestroyResultObjects(HoudiniComponentGuid);
InTOPNode->WorkResult.RemoveAt(Index);
InTOPNode->OnWorkItemRemoved(WorkResult.WorkItemID);
NumRemoved++;
bChanged = true;
}

WorkItemID should be stored as a local variable before line 1656, since reading a value of referenced structure that has already been destructed (line 1657) can be dangerous. When debugging editor or game with strict address case (e.g. enable unreal build with ASan), it always crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant