Skip to content

Fix extension soft lock when inspecting Dictionary variables with Variant key types - #854

Merged
DaelonSuzuka merged 1 commit into
godotengine:masterfrom
pminiszewski:master
May 11, 2025
Merged

Fix extension soft lock when inspecting Dictionary variables with Variant key types#854
DaelonSuzuka merged 1 commit into
godotengine:masterfrom
pminiszewski:master

Conversation

@pminiszewski

Copy link
Copy Markdown
Contributor

Hello,

In some cases the extension would soft lock making it impossible to inspect variables. The symptoms are very similar to #699, except this time the problem is caused by typed dictionaries that have Variant as a value type.

To reproduce try setting a breakpoint in the script below and inspecting contents of my_dict.
The issue replicates on Godot 4.4 (and possibly newer versions) on both Windows and MacOs.

extends Node

func _ready() -> void:
    var my_dict: Dictionary[int, Variant] = {5: "abc", 31: "Vector3(5, 6, 7)", 63: "xyzW"}
    print("")

The solution is to container check type flags and then decode type info only if flag is nonzero. If flag === 0 then there will be no type information included in the buffer.

@DaelonSuzuka

Copy link
Copy Markdown
Collaborator

This looks fine to me. Thanks for investigating this and contributing!

@DaelonSuzuka
DaelonSuzuka merged commit 29734ea into godotengine:master May 11, 2025
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

Successfully merging this pull request may close these issues.

2 participants