mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
fixes #11727 [backport]
This commit is contained in:
@@ -280,7 +280,7 @@ type
|
||||
ExceptionGotoUnhandled
|
||||
|
||||
proc findExceptionHandler(c: PCtx, f: PStackFrame, exc: PNode):
|
||||
tuple[why: ExceptionGoto, where: int] =
|
||||
tuple[why: ExceptionGoto, where: int] =
|
||||
let raisedType = exc.typ.skipTypes(abstractPtrs)
|
||||
|
||||
while f.safePoints.len > 0:
|
||||
@@ -1345,9 +1345,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
of opcQuit:
|
||||
if c.mode in {emRepl, emStaticExpr, emStaticStmt}:
|
||||
message(c.config, c.debug[pc], hintQuitCalled)
|
||||
msgQuit(int8(toInt(getOrdValue(regs[ra].regToNode))))
|
||||
msgQuit(int8(toInt(getOrdValue(regs[ra].regToNode, onError = toInt128(1)))))
|
||||
else:
|
||||
return TFullReg(kind: rkNone)
|
||||
of opcInvalidField:
|
||||
stackTrace(c, tos, pc, errFieldXNotFound & regs[ra].node.strVal)
|
||||
of opcSetLenStr:
|
||||
decodeB(rkNode)
|
||||
#createStrKeepNode regs[ra]
|
||||
|
||||
@@ -74,7 +74,7 @@ type
|
||||
opcContainsSet, opcRepr, opcSetLenStr, opcSetLenSeq,
|
||||
opcIsNil, opcOf, opcIs,
|
||||
opcSubStr, opcParseFloat, opcConv, opcCast,
|
||||
opcQuit,
|
||||
opcQuit, opcInvalidField,
|
||||
opcNarrowS, opcNarrowU,
|
||||
opcSignExtend,
|
||||
|
||||
|
||||
@@ -1719,8 +1719,13 @@ proc genCheckedObjAccessAux(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags
|
||||
# If the check fails let the user know
|
||||
let lab1 = c.xjmp(n, if negCheck: opcFJmp else: opcTJmp, rs)
|
||||
c.freeTemp(rs)
|
||||
# Not ideal but will do for the moment
|
||||
c.gABC(n, opcQuit)
|
||||
let strType = getSysType(c.graph, n.info, tyString)
|
||||
var fieldNameRegister: TDest = c.getTemp(strType)
|
||||
let strLit = newStrNode($accessExpr[1], accessExpr[1].info)
|
||||
strLit.typ = strType
|
||||
c.genLit(strLit, fieldNameRegister)
|
||||
c.gABC(n, opcInvalidField, fieldNameRegister)
|
||||
c.freeTemp(fieldNameRegister)
|
||||
c.patch(lab1)
|
||||
|
||||
proc genCheckedObjAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) =
|
||||
|
||||
Reference in New Issue
Block a user