Ruby: Workaround for optimiser problem.

A size 1 DataFlowType causes misoptimisations.
This commit is contained in:
Anders Schack-Mulligen
2022-01-10 11:21:18 +01:00
parent ef714f7328
commit c8a6798c05

View File

@@ -710,14 +710,16 @@ predicate clearsContent(Node n, Content c) {
FlowSummaryImpl::Private::Steps::summaryClearsContent(n, c)
}
private newtype TDataFlowType = TTodoDataFlowType()
private newtype TDataFlowType =
TTodoDataFlowType() or
TTodoDataFlowType2()
class DataFlowType extends TDataFlowType {
string toString() { result = "" }
}
/** Gets the type of `n` used for type pruning. */
DataFlowType getNodeType(NodeImpl n) { any() }
DataFlowType getNodeType(NodeImpl n) { result = TTodoDataFlowType() and exists(n) }
/** Gets a string representation of a `DataFlowType`. */
string ppReprType(DataFlowType t) { result = t.toString() }