Restrict pattern type guards to account for nested record matching failures

This commit is contained in:
Chris Smowton
2023-11-16 15:15:34 +00:00
parent d40311efe9
commit 6583c72c5d
6 changed files with 115 additions and 17 deletions

View File

@@ -197,7 +197,7 @@ private module Dispatch {
exists(TypeTestGuard typeTest, BaseSsaVariable v, Expr q, RefType t |
source.getQualifier() = q and
v.getAUse() = q and
typeTest.appliesTypeTest(v.getAUse(), t) and
typeTest.appliesTypeTest(v.getAUse(), t, false) and
guardControls_v1(typeTest, q.getBasicBlock(), false) and
tgt.getDeclaringType().getSourceDeclaration().getASourceSupertype*() = t.getErasure()
)