C++: Implement Field indirection.

This commit is contained in:
Geoffrey White
2024-03-19 16:48:27 +00:00
parent 393bd7277c
commit 73e95d67b9
4 changed files with 19 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ module Input implements InputSig<DataFlowImplSpecific::CppDataFlow> {
string encodeContent(ContentSet cs, string arg) {
exists(FieldContent c |
cs.isSingleton(c) and
result = "Field" and
result = indirectionString(c.getIndirectionIndex()) + "Field" and
arg = c.getField().getName()
)
}
@@ -81,6 +81,15 @@ module Input implements InputSig<DataFlowImplSpecific::CppDataFlow> {
)
)
}
bindingset[token]
ContentSet decodeUnknownContent(AccessPath::AccessPathTokenBase token) {
// field content (with indirection support).
exists(FieldContent c |
result.isSingleton(c) and
token = indirectionString(c.getIndirectionIndex()) + c.getField().getName()
)
}
}
private import Make<DataFlowImplSpecific::CppDataFlow, Input> as Impl