better error message for subtle nil errors
This commit is contained in:
parent
a8ba628bcd
commit
8c211113f2
4 changed files with 8 additions and 3 deletions
|
|
@ -346,6 +346,8 @@ proc resetLoc(p: BProc, loc: var TLoc) =
|
|||
else:
|
||||
linefmt(p, cpsStmts, "$1 = 0;$n", rdLoc(loc))
|
||||
else:
|
||||
if optNilCheck in p.options:
|
||||
linefmt(p, cpsStmts, "#chckNil((void*)$1);$n", addrLoc(loc))
|
||||
if loc.s != OnStack:
|
||||
linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n",
|
||||
addrLoc(loc), genTypeInfo(p.module, loc.t))
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ var
|
|||
gOptions*: TOptions = {optObjCheck, optFieldCheck, optRangeCheck,
|
||||
optBoundsCheck, optOverflowCheck, optAssert, optWarns,
|
||||
optHints, optStackTrace, optLineTrace,
|
||||
optPatterns}
|
||||
optPatterns, optNilCheck}
|
||||
gGlobalOptions*: TGlobalOptions = {optThreadAnalysis}
|
||||
gExitcode*: int8
|
||||
gCmd*: TCommands = cmdNone # the command
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue