This commit is contained in:
Andreas Rumpf 2017-03-26 09:30:59 +02:00 • committed by GitHub
commit 1268ca79e5
6 changed files with 26 additions and 9 deletions

View file

@ -50,7 +50,11 @@ proc chckRangeF(x, a, b: float): float =
proc chckNil(p: pointer) =
if p == nil:
sysFatal(ValueError, "attempt to write to a nil address")
sysFatal(NilAccessError, "attempt to write to a nil address")
proc chckNilDisp(p: pointer) {.compilerproc.} =
if p == nil:
sysFatal(NilAccessError, "cannot dispatch; dispatcher is nil")
proc chckObj(obj, subclass: PNimType) {.compilerproc.} =
# checks if obj is of type subclass:

View file

@ -642,6 +642,10 @@ proc toU32*(a: int64): int32 {.asmNoStackFrame, compilerproc.} =
proc nimMin(a, b: int): int {.compilerproc.} = return if a <= b: a else: b
proc nimMax(a, b: int): int {.compilerproc.} = return if a >= b: a else: b
proc chckNilDisp(p: pointer) {.compilerproc.} =
if p == nil:
sysFatal(NilAccessError, "cannot dispatch; dispatcher is nil")
type NimString = string # hack for hti.nim
include "system/hti"