Skip to content

🐛 ensure typeinfo and vtable information is present for CompoundOperation#548

Merged
burgholzer merged 3 commits into
mainfrom
fix-compound-operation-vtable-entry
Feb 8, 2024
Merged

🐛 ensure typeinfo and vtable information is present for CompoundOperation#548
burgholzer merged 3 commits into
mainfrom
fix-compound-operation-vtable-entry

Conversation

@burgholzer

Copy link
Copy Markdown
Member

Description

This PR ensures that all the different Operation sub-classes get a corresponding typeinfo and vtable symbol in the compiled binaries. This is important for RTTI when using shared libraries and ensured that dynamic_casts across library boundaries work as intended. Specifically, the CompoundOperation class was only defined in a header, which led to the omission of said information. This is fixed by creating a dedicated .cpp file and moving at least one definition there.

This was discovered while working on #538 in combination with mqt-ddsim.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@burgholzer burgholzer added fix Fix for something that isn't working Core Anything related to the Core library and IR c++ Anything related to C++ code labels Feb 8, 2024
@burgholzer burgholzer self-assigned this Feb 8, 2024
@burgholzer burgholzer enabled auto-merge (squash) February 8, 2024 15:22
@codecov

codecov Bot commented Feb 8, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (2141558) 91.2% compared to head (4069945) 91.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #548     +/-   ##
=======================================
- Coverage   91.2%   91.0%   -0.2%     
=======================================
  Files        130     131      +1     
  Lines      13639   13664     +25     
  Branches    2144    2150      +6     
=======================================
+ Hits       12442   12444      +2     
- Misses      1197    1220     +23     
Flag Coverage Δ
cpp 90.7% <81.9%> (-0.2%) ⬇️
python 99.5% <ø> (ø)
Files Coverage Δ
include/mqt-core/operations/CompoundOperation.hpp 100.0% <100.0%> (+6.7%) ⬆️
src/operations/CompoundOperation.cpp 81.7% <81.7%> (ø)

... and 1 file with indirect coverage changes

@burgholzer burgholzer merged commit 55752ce into main Feb 8, 2024
@burgholzer burgholzer deleted the fix-compound-operation-vtable-entry branch February 8, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code Core Anything related to the Core library and IR fix Fix for something that isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant