Merge pull request #2499 from JosephTurner/fix-uint-segv
Fixes #1986 when calling sameConstant on uint
This commit is contained in:
commit
fdadc177d4
2 changed files with 11 additions and 1 deletions
|
|
@ -368,7 +368,7 @@ proc sameConstant*(a, b: PNode): bool =
|
|||
case a.kind
|
||||
of nkSym: result = a.sym == b.sym
|
||||
of nkIdent: result = a.ident.id == b.ident.id
|
||||
of nkCharLit..nkInt64Lit: result = a.intVal == b.intVal
|
||||
of nkCharLit..nkUInt64Lit: result = a.intVal == b.intVal
|
||||
of nkFloatLit..nkFloat64Lit: result = a.floatVal == b.floatVal
|
||||
of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal
|
||||
of nkType, nkNilLit: result = a.typ == b.typ
|
||||
|
|
|
|||
10
tests/tuples/tuint_tuple.nim
Normal file
10
tests/tuples/tuint_tuple.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# bug #1986 found by gdmoore
|
||||
|
||||
proc test(): int64 =
|
||||
return 0xdeadbeef.int64
|
||||
|
||||
const items = [
|
||||
(var1: test(), var2: 100'u32),
|
||||
(var1: test(), var2: 192'u32)
|
||||
]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue