-
Notifications
You must be signed in to change notification settings - Fork 126
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
Panic - not a word value
ccatV left
and ccatV right
#1435
Comments
Oddly enough
|
Focusing on the
The only way to make Anyways, why does cryptol/src/Cryptol/Eval/Generic.hs Lines 1188 to 1200 in 8cca245
This code is correct if we uphold the invariant that both cryptol/src/Cryptol/Eval/Generic.hs Lines 1449 to 1461 in 8cca245
This always returns a Instead of returning diff --git a/src/Cryptol/Eval/Generic.hs b/src/Cryptol/Eval/Generic.hs
index 204658b9..946f41ee 100644
--- a/src/Cryptol/Eval/Generic.hs
+++ b/src/Cryptol/Eval/Generic.hs
@@ -1452,12 +1452,12 @@ fromToV sym =
PNumPoly \first ->
PNumPoly \lst ->
PTyPoly \ty ->
- PVal
+ PPrim
let !f = mkLit sym ty in
case (first, lst) of
(Nat first', Nat lst') ->
let len = 1 + (lst' - first')
- in VSeq len $ indexSeqMap $ \i -> f (first' + i)
+ in mkSeq sym (Nat len) ty $ indexSeqMap $ \i -> f (first' + i)
_ -> evalPanic "fromToV" ["invalid arguments"]
{-# INLINE fromThenToV #-} I think we'd need to do something similar for various other operations that always return |
Previous, `fromTo` and related functions would always return a `VSeq`. If the type happened to be a `Bit`, this would violate the internal invariant that sequences of `Bit`s are always represented with `VWord`s, leading to the panics observed in #1435. This patch fixes the issue by using the `mkSeq` smart constructor, which chooses between `VWord` and `VSeq` depending on the sequence type. Fixes #1435.
Previous, `fromTo` and related functions would always return a `VSeq`. If the type happened to be a `Bit`, this would violate the internal invariant that sequences of `Bit`s are always represented with `VWord`s, leading to the panics observed in #1435. This patch fixes the issue by using the `mkSeq` smart constructor, which chooses between `VWord` and `VSeq` depending on the sequence type. Fixes #1435.
The text was updated successfully, but these errors were encountered: