Fix segfault in declaration-export type walker on unregistered types - #237
Merged
Conversation
…ions with checks and early returns
Merged
4 tasks
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.
Summary
NDEBUG), the--export=alldeclaration-export walker inMLIRGenImpl.hdereferenced a nullClassInfo/InterfaceInfo/EnumInfoshared_ptr when a referenced type (e.g. one reachable only from adeclare functionsignature in a.d.tsfile) wasn't registered in the corresponding lookup map. The only guard wasassert(...), which is compiled out in release builds, so the lookup miss fell straight through to a null-pointer dereference — matching the reporter's gdb backtrace throughaddClassDeclarationToExport.addDependancyTypesToExportNoCheckandaddTypeDeclarationToExportNoCheckwith graceful early-returns, matching the existing safe null-check pattern already used elsewhere (MLIRTypeIterator.h) for the same kind of lookup.Test plan
MLIRGenClasses.cppandMLIRGenModule.cpp(both include the modified header) — no new warnings/errors.BrowserLibrepro project would be a good end-to-end check once the default lib withUint8Array/typed-array support is available in this environment.🤖 Generated with Claude Code