-
Notifications
You must be signed in to change notification settings - Fork 286
fix: panic on assembler source manager mismatch #2987
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -920,9 +920,9 @@ impl Assembler { | |
| continue; | ||
| } | ||
| // Fetch procedure metadata from the graph | ||
| let (module_kind, module_path) = { | ||
| let (module_kind, module_path, module_source_file) = { | ||
| let module = &self.linker[procedure_gid.module]; | ||
| (module.kind(), module.path().clone()) | ||
| (module.kind(), module.path().clone(), module.source_file().cloned()) | ||
| }; | ||
| match self.linker[procedure_gid].item() { | ||
| SymbolItem::Procedure(proc) => { | ||
|
|
@@ -954,8 +954,11 @@ impl Assembler { | |
| // be added to the forest. | ||
|
|
||
| // Record the debug info for this procedure | ||
| self.debug_info | ||
| .register_procedure_debug_info(&procedure, self.source_manager.as_ref())?; | ||
| self.debug_info.register_procedure_debug_info( | ||
| &procedure, | ||
| self.source_manager.as_ref(), | ||
| module_source_file.as_deref(), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The source-manager check lands too late here.
I reproduced that with a module parsed in one manager and assembled in another using
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved the source-manager check to linking time so it covers this. |
||
| )?; | ||
|
|
||
| // Cache the compiled procedure | ||
| drop(proc); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reflecting @bitwalker 's review on #3007 :