system files use new identifiers
This commit is contained in:
parent
dbf9117c56
commit
fc0fda14ae
13 changed files with 371 additions and 338 deletions
|
|
@ -13,13 +13,13 @@ proc raiseRangeError(val: BiggestInt) {.compilerproc, noreturn, noinline.} =
|
|||
when hostOS == "standalone":
|
||||
sysFatal(EOutOfRange, "value out of range")
|
||||
else:
|
||||
sysFatal(EOutOfRange, "value out of range: ", $val)
|
||||
sysFatal(RangeError, "value out of range: ", $val)
|
||||
|
||||
proc raiseIndexError() {.compilerproc, noreturn, noinline.} =
|
||||
sysFatal(EInvalidIndex, "index out of bounds")
|
||||
sysFatal(IndexError, "index out of bounds")
|
||||
|
||||
proc raiseFieldError(f: string) {.compilerproc, noreturn, noinline.} =
|
||||
sysFatal(EInvalidField, f, " is not accessible")
|
||||
sysFatal(FieldError, f, " is not accessible")
|
||||
|
||||
proc chckIndx(i, a, b: int): int =
|
||||
if i >= a and i <= b:
|
||||
|
|
@ -46,11 +46,11 @@ proc chckRangeF(x, a, b: float): float =
|
|||
when hostOS == "standalone":
|
||||
sysFatal(EOutOfRange, "value out of range")
|
||||
else:
|
||||
sysFatal(EOutOfRange, "value out of range: ", $x)
|
||||
sysFatal(RangeError, "value out of range: ", $x)
|
||||
|
||||
proc chckNil(p: pointer) =
|
||||
if p == nil:
|
||||
sysFatal(EInvalidValue, "attempt to write to a nil address")
|
||||
sysFatal(ValueError, "attempt to write to a nil address")
|
||||
#c_raise(SIGSEGV)
|
||||
|
||||
proc chckObj(obj, subclass: PNimType) {.compilerproc.} =
|
||||
|
|
@ -59,13 +59,13 @@ proc chckObj(obj, subclass: PNimType) {.compilerproc.} =
|
|||
if x == subclass: return # optimized fast path
|
||||
while x != subclass:
|
||||
if x == nil:
|
||||
sysFatal(EInvalidObjectConversion, "invalid object conversion")
|
||||
sysFatal(ObjectConversionError, "invalid object conversion")
|
||||
break
|
||||
x = x.base
|
||||
|
||||
proc chckObjAsgn(a, b: PNimType) {.compilerproc, inline.} =
|
||||
if a != b:
|
||||
sysFatal(EInvalidObjectAssignment, "invalid object assignment")
|
||||
sysFatal(ObjectAssignmentError, "invalid object assignment")
|
||||
|
||||
type ObjCheckCache = array[0..1, PNimType]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue