Skip to content
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

🩹 fix endless loop on unsupported operations in OpenQASM gate declarations #700

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

burgholzer
Copy link
Member

Description

This PR fixes an endless loop in the OpenQASM parser upon encountering unexpected statements in gate declarations.
WIth this PR, the parser actually errors out with an appropriate error message instead of looping forever.

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 self-assigned this Sep 19, 2024
@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 Sep 19, 2024
@burgholzer burgholzer added this to the OpenQASM 3.0 Support milestone Sep 19, 2024
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.1%. Comparing base (698af02) to head (b8fd529).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #700     +/-   ##
=======================================
- Coverage   92.1%   92.1%   -0.1%     
=======================================
  Files        125     125             
  Lines      13759   13757      -2     
  Branches    2151    2150      -1     
=======================================
- Hits       12673   12671      -2     
  Misses      1086    1086             
Flag Coverage Δ
cpp 91.8% <100.0%> (-0.1%) ⬇️
python 99.7% <ø> (ø)
Files with missing lines Coverage Δ
src/ir/parsers/qasm3_parser/Parser.cpp 92.6% <100.0%> (-0.1%) ⬇️

@burgholzer burgholzer enabled auto-merge (squash) September 19, 2024 19:26
@burgholzer burgholzer merged commit 95af9bf into main Sep 19, 2024
27 checks passed
@burgholzer burgholzer deleted the unexpected-statement-in-gate-declaration branch September 19, 2024 19:33
burgholzer added a commit to cda-tum/mqt-ddvis that referenced this pull request Sep 19, 2024
This PR fixes #281 by updating mqt-core to a version that includes
cda-tum/mqt-core#700.

Signed-off-by: burgholzer <[email protected]>
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
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant