diff options
author | Araq <rumpf_a@web.de> | 2012-02-02 02:40:21 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-02-02 02:40:21 +0100 |
commit | 3af91064e56aab8a067f38b42c51665fb567383e (patch) | |
tree | ab3fdd8116a99fd71d9343cbe5a2b5b57282f461 /lib | |
parent | 7efe817ca3ad2323a8200b2f73539da4b9bfad24 (diff) | |
download | Nim-3af91064e56aab8a067f38b42c51665fb567383e.tar.gz |
bugfix: reprEnum
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system/repr.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/system/repr.nim b/lib/system/repr.nim index 51498b3f5..2dec8136c 100755 --- a/lib/system/repr.nim +++ b/lib/system/repr.nim @@ -50,6 +50,8 @@ proc reprChar(x: char): string {.compilerRtl.} = add result, "\'" proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} = + # we read an 'int' but this may have been too large, so mask the other bits: + let e = e and (1 shl (typ.size*8)-1) if ntfEnumHole notin typ.flags: if e <% typ.node.len: return $typ.node.sons[e].name |