From 3606e035f5f4d688876a83f824f7e7b3ac4ff083 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 28 Jun 2019 21:13:03 +0200 Subject: fixes #11606 --- compiler/msgs.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'compiler') 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) -- cgit 1.4.1-2-gfad0