mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
hotfix: discriminants can be of size 8 bytes [backport]
This commit is contained in:
@@ -106,6 +106,7 @@ proc getDiscriminant(aa: pointer, n: ptr TNimNode): int =
|
||||
of 1: d = ze(cast[ptr int8](a +% n.offset)[])
|
||||
of 2: d = ze(cast[ptr int16](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)
|
||||
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 2: d = ze(cast[ptr int16](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")
|
||||
return d
|
||||
|
||||
|
||||
Reference in New Issue
Block a user