diff options
author | Joseph Turner <turner.d.joseph@gmail.com> | 2015-04-09 03:59:08 +0100 |
---|---|---|
committer | Joseph Turner <turner.d.joseph@gmail.com> | 2015-04-09 03:59:08 +0100 |
commit | 0fa82763feff2b7af67af19a86fb1e1dafe5f3bc (patch) | |
tree | a63f22c7308920cf30e11d3b83edf150bc3a7ae0 /compiler | |
parent | b48f9c4e1440b28fedddec4833553e8f60648ec4 (diff) | |
download | Nim-0fa82763feff2b7af67af19a86fb1e1dafe5f3bc.tar.gz |
Fixes #1986 when calling sameConstant on uint
The problem was saveConstant only checked the range `nkCharLit..nkInt64Lit`, but not up to UInt. This lead to the sonsLen method being called, where sons was never declared. This commit changes it to `nkCharLit..nkUint64Lit`, to match the case statements in the type definition of TNode, in ast.nim.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/vmgen.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 3178bee60..c3013852d 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -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 |