[os:standalone]fix #14011 (#17564)

This commit is contained in:
flywind 2021-03-29 23:54:28 +08:00 • committed by GitHub
commit 7ad49950bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 2 deletions

View file

@ -29,10 +29,16 @@ proc raiseFieldError(f: string) {.compilerproc, noinline.} =
sysFatal(FieldDefect, f)
proc raiseRangeErrorI(i, a, b: BiggestInt) {.compilerproc, noinline.} =
sysFatal(RangeDefect, "value out of range: " & $i & " notin " & $a & " .. " & $b)
when defined(standalone):
sysFatal(RangeDefect, "value out of range")
else:
sysFatal(RangeDefect, "value out of range: " & $i & " notin " & $a & " .. " & $b)
proc raiseRangeErrorF(i, a, b: float) {.compilerproc, noinline.} =
sysFatal(RangeDefect, "value out of range: " & $i & " notin " & $a & " .. " & $b)
when defined(standalone):
sysFatal(RangeDefect, "value out of range")
else:
sysFatal(RangeDefect, "value out of range: " & $i & " notin " & $a & " .. " & $b)
proc raiseRangeErrorU(i, a, b: uint64) {.compilerproc, noinline.} =
# todo: better error reporting