diff options
author | 2014-04-01 11:48:01 +0100 | |
---|---|---|
committer | 2014-04-01 11:48:01 +0100 | |
commit | 8f239eb00613e103a0ed762ce6584cf033d29d48 (patch) | |
tree | 88d145ad7ec927060c5176ffb17b6f8e8c122143 /Source/Core | |
parent | 1ed471d7e479f2cec0e24249607e1bb31a181044 (diff) |
Fixed class cast issue with type synonyms
Diffstat (limited to 'Source/Core')
-rw-r--r-- | Source/Core/AbsyType.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/AbsyType.cs b/Source/Core/AbsyType.cs index 4efe1aea..00e1a5c6 100644 --- a/Source/Core/AbsyType.cs +++ b/Source/Core/AbsyType.cs @@ -2093,6 +2093,11 @@ Contract.Requires(that != null); private static int MinBitsFor(Type t) {
Contract.Requires(t != null);
Contract.Requires(t.IsBv);
+
+ if (t is TypeSynonymAnnotation) {
+ return MinBitsFor(((TypeSynonymAnnotation)t).ExpandedType);
+ }
+
Contract.Ensures(0 <= Contract.Result<int>());
if (t is BvType) {
return t.BvBits;
@@ -2195,6 +2200,11 @@ Contract.Requires(that != null); Contract.Requires(t != null);
Contract.Requires(t.IsBv && 0 <= to && MinBitsFor(t) <= to);
Contract.Ensures(0 <= Contract.Result<int>() && Contract.Result<int>() <= to);
+
+ if(t is TypeSynonymAnnotation) {
+ return IncreaseBits(((TypeSynonymAnnotation)t).ExpandedType, to);
+ }
+
t = FollowProxy(t);
if (t is BvType) {
return to - t.BvBits;
|