Skip to content

rtti: retain named-module initializer hashes - #3543

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/rtti-init-mnh
Jul 22, 2026
Merged

rtti: retain named-module initializer hashes#3543
borisbat merged 1 commit into
masterfrom
bbatkin/rtti-init-mnh

Conversation

@borisbat

Copy link
Copy Markdown
Collaborator

Summary

  • resolve generated structure initializers from the module's simple-name function index
  • select the zero-argument function returning the exact structure before recording its mangled-name hash
  • add a named-module RTTI regression that compares StructInfo.init_mnh with FuncInfo.hash

Validation

  • focused interpreter regression: 1 passed
  • focused AOT regression: 1 passed
  • formatter verification: clean
  • linter: 0 issues, 0 errors
  • full preflight: 13 passed, 0 failed (local tool/DLL-lock skips left to CI)

Copilot AI review requested due to automatic review settings July 22, 2026 20:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes how RTTI records a structure’s generated initializer mangled-name hash (StructInfo.init_mnh) when the structure lives in a named module, and adds a regression test to ensure the hash matches the corresponding function’s FuncInfo.hash.

Changes:

  • Resolve generated structure initializers via the module’s functionsByName index (simple-name lookup) instead of findFunction on an unmangled name.
  • Select the matching zero-argument function that returns the exact structure before recording init_mnh.
  • Add a named-module RTTI regression test and document it in the tests README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/README.md Adds the new RTTI regression test to the language tests list.
tests/language/test_rtti_init_mnh.das New regression ensuring StructInfo.init_mnh matches the initializer FuncInfo.hash in a named module.
src/ast/ast_debug_info_helper.cpp Updates RTTI debug-info emission to find the correct initializer function in named modules and store its mangled-name hash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@borisbat
borisbat merged commit 7943043 into master Jul 22, 2026
36 checks passed
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