summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-06-28 21:13:03 +0200
committerAraq <rumpf_a@web.de>2019-06-28 21:13:03 +0200
commit3606e035f5f4d688876a83f824f7e7b3ac4ff083 (patch)
tree9009fa3550e319ab1117650d5aa8819dbecb70c5 /compiler
parent7ddb31262e4773c0bf5a14cf89637b590c6ad5d8 (diff)
downloadNim-3606e035f5f4d688876a83f824f7e7b3ac4ff083.tar.gz
fixes #11606
Diffstat (limited to 'compiler')
-rw-r--r--compiler/msgs.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 2491e0daa..436260d4b 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -96,8 +96,14 @@ proc fileInfoIdx*(conf: ConfigRef; filename: AbsoluteFile): FileIndex =
 
 proc newLineInfo*(fileInfoIdx: FileIndex, line, col: int): TLineInfo =
   result.fileIndex = fileInfoIdx
-  result.line = uint16(line)
-  result.col = int16(col)
+  if line < int high(uint16):
+    result.line = uint16(line)
+  else:
+    result.line = high(uint16)
+  if col < int high(int16):
+    result.col = int16(col)
+  else:
+    result.col = -1
 
 proc newLineInfo*(conf: ConfigRef; filename: AbsoluteFile, line, col: int): TLineInfo {.inline.} =
   result = newLineInfo(fileInfoIdx(conf, filename), line, col)