Repository navigation
fix(elements): guard UDT extended-attribute lookups against absent keys - #51
Merged
hutcheb merged 1 commit intoNov 3, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DataTypeBuilder.build()raisesKeyErrorwhen a UDT lacks certain extended attributesSymptom
raised from:
(
0x6C == 108), aborting the entire export. The same bare-dict-lookuppattern is used two lines later for
0x67(built_in) and0x69(
module_defined), which would fail the same way if either were missinginstead.
Root cause
DataTypeBuilder.build()assumes every UDT's extended-record set carriesattributes
0x6C(string-family flag),0x67(built-in flag) and0x69(module-defined flag). On real project files, plain user-defined types with
no string-family/module-defined role don't always carry these — the code a
few lines below this one already handles exactly this situation correctly
for a different attribute (
0x64, member count):0x6C/0x67/0x69just never got the same treatment.Fix
Apply the identical guarded-lookup pattern already used for
0x64to0x6C,0x67, and0x69: default to0(the "plain UDT" reading —NoFamily/ not built-in / not module-defined) when the attribute isabsent or the wrong length, instead of a bare dict index that raises.
Suggested validation
Any UDT whose extended-record set is missing one of these three attributes
should now export as a normal
DataTypewithNoFamily/User/not-built-indefaults instead of aborting the whole file.
🤖 Generated with Claude Code