Of operator in vm fixes [backport] (#9717)
* fixes #9701 * fixes #9702 * optimize of statement to bool
This commit is contained in:
parent
2104863910
commit
8c1083d3b7
6 changed files with 65 additions and 7 deletions
|
|
@ -1086,8 +1086,8 @@ proc inheritanceDiff*(a, b: PType): int =
|
|||
# | returns: +x iff `a` is the x'th direct subclass of `b`
|
||||
# | returns: `maxint` iff `a` and `b` are not compatible at all
|
||||
if a == b or a.kind == tyError or b.kind == tyError: return 0
|
||||
assert a.kind == tyObject
|
||||
assert b.kind == tyObject
|
||||
assert a.kind in {tyObject} + skipPtrs
|
||||
assert b.kind in {tyObject} + skipPtrs
|
||||
var x = a
|
||||
result = 0
|
||||
while x != nil:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue