hotfix: discriminants can be of size 8 bytes [backport]
This commit is contained in:
parent
d215296497
commit
24106ade8f
2 changed files with 2 additions and 0 deletions
|
|
@ -106,6 +106,7 @@ proc getDiscriminant(aa: pointer, n: ptr TNimNode): int =
|
||||||
of 1: d = ze(cast[ptr int8](a +% n.offset)[])
|
of 1: d = ze(cast[ptr int8](a +% n.offset)[])
|
||||||
of 2: d = ze(cast[ptr int16](a +% n.offset)[])
|
of 2: d = ze(cast[ptr int16](a +% n.offset)[])
|
||||||
of 4: d = int(cast[ptr int32](a +% n.offset)[])
|
of 4: d = int(cast[ptr int32](a +% n.offset)[])
|
||||||
|
of 8: d = int(cast[ptr int64](a +% n.offset)[])
|
||||||
else: assert(false)
|
else: assert(false)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3461,6 +3461,7 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
of 1: d = ze(cast[ptr int8](a +% n.offset)[])
|
of 1: d = ze(cast[ptr int8](a +% n.offset)[])
|
||||||
of 2: d = ze(cast[ptr int16](a +% n.offset)[])
|
of 2: d = ze(cast[ptr int16](a +% n.offset)[])
|
||||||
of 4: d = int(cast[ptr int32](a +% n.offset)[])
|
of 4: d = int(cast[ptr int32](a +% n.offset)[])
|
||||||
|
of 8: d = int(cast[ptr int64](a +% n.offset)[])
|
||||||
else: sysAssert(false, "getDiscriminant: invalid n.typ.size")
|
else: sysAssert(false, "getDiscriminant: invalid n.typ.size")
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue