This commit is contained in:
Araq 2015-11-18 14:42:13 +01:00
commit 1757b8466d

View file

@ -255,9 +255,12 @@ proc cleanUpOnException(c: PCtx; tos: PStackFrame):
nextExceptOrFinally = pc2 + c.code[pc2].regBx - wordExcess
inc pc2
while c.code[pc2].opcode == opcExcept:
let exceptType = c.types[c.code[pc2].regBx-wordExcess].skipTypes(
let excIndex = c.code[pc2].regBx-wordExcess
let exceptType = if excIndex > 0: c.types[excIndex].skipTypes(
abstractPtrs)
if inheritanceDiff(exceptType, raisedType) <= 0:
else: nil
#echo typeToString(exceptType), " ", typeToString(raisedType)
if exceptType.isNil or inheritanceDiff(exceptType, raisedType) <= 0:
# mark exception as handled but keep it in B for
# the getCurrentException() builtin:
c.currentExceptionB = c.currentExceptionA