From 29734ea849becb1b4e368b4488e9c7ac3d7e7c00 Mon Sep 17 00:00:00 2001 From: EF Date: Sun, 11 May 2025 22:28:23 +0200 Subject: [PATCH] Fix extension soft lock when inspecting Dictionary variables with Variant key types (#854) Co-authored-by: Pawel Miniszewski --- src/debugger/godot4/variables/variant_decoder.ts | 3 +++ src/debugger/godot4/variables/variants.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/debugger/godot4/variables/variant_decoder.ts b/src/debugger/godot4/variables/variant_decoder.ts index 8a5b792..a78214d 100644 --- a/src/debugger/godot4/variables/variant_decoder.ts +++ b/src/debugger/godot4/variables/variant_decoder.ts @@ -210,6 +210,9 @@ export class VariantDecoder { private decode_ContainerTypeFlag(model: BufferModel, type: GDScriptTypes, bitOffset: number) { const shiftedType = (type >> bitOffset) & 0b11; + if (shiftedType === ContainerTypeFlags.NONE) { + return 0; + } if (shiftedType === ContainerTypeFlags.BUILTIN) { return this.decode_UInt32(model); } else { diff --git a/src/debugger/godot4/variables/variants.ts b/src/debugger/godot4/variables/variants.ts index 39fea63..10e8e28 100644 --- a/src/debugger/godot4/variables/variants.ts +++ b/src/debugger/godot4/variables/variants.ts @@ -58,6 +58,7 @@ export const ENCODE_FLAG_TYPED_ARRAY_MASK = 0b11 << 16; export const ENCODE_FLAG_TYPED_DICT_MASK = 0b1111 << 16; export enum ContainerTypeFlags { + NONE = 0, BUILTIN = 1, CLASS_NAME = 2, SCRIPT = 3,