You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes the generated RIR program to be missing branch and jump terminator instructions at the end of blocks. The empty block (should have one terminating jump) is what triggers the specific panic, but other non-empty blocks also are missing terminators that mean the program is invalid.
Either the early return should be fully handled by refactoring the control flow handling for dynamic branches (which must correctly handling inlining for functions like the example above) or the RuntimeFeatureFlags::ReturnWithinDynamicScope should be updated to require more than just TargetCapabilityFlags::Adaptive so that RCA rejects this pattern at compile time.
The text was updated successfully, but these errors were encountered:
The following code causes a panic in QIR generation:
However, the same code with implicit returns in the function works as expected:
This appears to be because of how the
BranchControlFlow::Return
is used to short circuit the handling of the rest of the block:qsharp/compiler/qsc_partial_eval/src/lib.rs
Lines 1837 to 1839 in cd5c2e3
This causes the generated RIR program to be missing branch and jump terminator instructions at the end of blocks. The empty block (should have one terminating jump) is what triggers the specific panic, but other non-empty blocks also are missing terminators that mean the program is invalid.
Either the early return should be fully handled by refactoring the control flow handling for dynamic branches (which must correctly handling inlining for functions like the example above) or the
RuntimeFeatureFlags::ReturnWithinDynamicScope
should be updated to require more than justTargetCapabilityFlags::Adaptive
so that RCA rejects this pattern at compile time.The text was updated successfully, but these errors were encountered: