Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@theRoughCode
Copy link
Contributor

This PR fixes the StackOverflow error encountered in #270. This is because arguments of type bool[] in Q# are represented as IQArray<Boolean> in the simulator which should get matched to an array type within GetNonQubitArgsAsString but instead matches the IApplyData type. When that happens, we encounter an infinite loop: IQArray<Boolean> -> System.RuntimeType -> System.RuntimeType -> ...

To fix this, we move the check for IApplyData to the bottom so that we match that case last (as it's the culprit for stack overflow errors). As further precaution, we also add a check to see if IApplyData.Value is the same as the original value, preventing possible infinite recursion.

@anpaz anpaz merged commit 8d11a6f into master Aug 17, 2020
@anpaz anpaz deleted the raphael/qarrayargs branch August 17, 2020 21:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants