Skip to content

Commit 8fc9ce9

Browse files
tausbnyoff
andauthored
Python: Fix bad join in MRO
Fixes a bad join in `list_of_linearization_of_bases_plus_bases`. Previvously, we joined together `ConsList` and `getBase` before filtering these out using the recursive call. Now we do the recursion first. Co-authored-by: yoff <yoff@github.com>
1 parent 3543864 commit 8fc9ce9

File tree

1 file changed

+3
-1
lines changed
  • python/ql/lib/semmle/python/pointsto

1 file changed

+3
-1
lines changed

python/ql/lib/semmle/python/pointsto/MRO.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ private ClassListList list_of_linearization_of_bases_plus_bases(ClassObjectInter
419419
result = ConsList(bases(cls), EmptyList()) and n = Types::base_count(cls) and n > 1
420420
or
421421
exists(ClassListList partial |
422-
partial = list_of_linearization_of_bases_plus_bases(cls, n + 1) and
422+
partial =
423+
list_of_linearization_of_bases_plus_bases(pragma[only_bind_into](cls),
424+
pragma[only_bind_into](n + 1)) and
423425
result = ConsList(Mro::newStyleMro(Types::getBase(cls, n)), partial)
424426
)
425427
}

0 commit comments

Comments
 (0)