use of de.fraunhofer.aisec.cpg.graph.statements.expressions.InitializerListExpression in project cpg by Fraunhofer-AISEC.
the class VariableDeclaration method typeChanged.
@Override
public void typeChanged(HasType src, HasType root, Type oldType) {
if (!TypeManager.isTypeSystemActive()) {
return;
}
if (!TypeManager.getInstance().isUnknown(this.type) && src.getPropagationType().equals(oldType)) {
return;
}
Type previous = this.type;
Type newType;
if (src == initializer && initializer instanceof InitializerListExpression) {
// can be ignored once we have a type
if (isArray) {
newType = src.getType();
} else if (!TypeManager.getInstance().isUnknown(this.type)) {
return;
} else {
newType = src.getType().dereference();
}
} else {
newType = src.getPropagationType();
}
setType(newType, root);
if (!previous.equals(this.type)) {
this.type.setTypeOrigin(Type.Origin.DATAFLOW);
}
}
use of de.fraunhofer.aisec.cpg.graph.statements.expressions.InitializerListExpression in project cpg by Fraunhofer-AISEC.
the class FieldDeclaration method typeChanged.
@Override
public void typeChanged(HasType src, Collection<HasType> root, Type oldType) {
if (!TypeManager.isTypeSystemActive()) {
return;
}
if (!TypeManager.getInstance().isUnknown(this.type) && src.getPropagationType().equals(oldType)) {
return;
}
Type previous = this.type;
Type newType;
if (src == initializer && initializer instanceof InitializerListExpression) {
// can be ignored once we have a type
if (isArray) {
newType = src.getType();
} else if (!TypeManager.getInstance().isUnknown(this.type)) {
return;
} else {
newType = src.getType().dereference();
}
} else {
newType = src.getPropagationType();
}
setType(newType, root);
if (!previous.equals(this.type)) {
this.type.setTypeOrigin(Type.Origin.DATAFLOW);
}
}
use of de.fraunhofer.aisec.cpg.graph.statements.expressions.InitializerListExpression in project cpg by Fraunhofer-AISEC.
the class VariableDeclaration method typeChanged.
@Override
public void typeChanged(HasType src, Collection<HasType> root, Type oldType) {
if (!TypeManager.isTypeSystemActive()) {
return;
}
if (!TypeManager.getInstance().isUnknown(this.type) && src.getPropagationType().equals(oldType)) {
return;
}
Type previous = this.type;
Type newType;
if (src == initializer && initializer instanceof InitializerListExpression) {
// can be ignored once we have a type
if (isArray) {
newType = src.getType();
} else if (!TypeManager.getInstance().isUnknown(this.type)) {
return;
} else {
newType = src.getType().dereference();
}
} else {
newType = src.getPropagationType();
}
setType(newType, root);
if (!previous.equals(this.type)) {
this.type.setTypeOrigin(Type.Origin.DATAFLOW);
}
}
use of de.fraunhofer.aisec.cpg.graph.statements.expressions.InitializerListExpression in project cpg by Fraunhofer-AISEC.
the class FieldDeclaration method typeChanged.
@Override
public void typeChanged(HasType src, HasType root, Type oldType) {
if (!TypeManager.isTypeSystemActive()) {
return;
}
if (!TypeManager.getInstance().isUnknown(this.type) && src.getPropagationType().equals(oldType)) {
return;
}
Type previous = this.type;
Type newType;
if (src == initializer && initializer instanceof InitializerListExpression) {
// can be ignored once we have a type
if (isArray) {
newType = src.getType();
} else if (!TypeManager.getInstance().isUnknown(this.type)) {
return;
} else {
newType = src.getType().dereference();
}
} else {
newType = src.getPropagationType();
}
setType(newType, root);
if (!previous.equals(this.type)) {
this.type.setTypeOrigin(Type.Origin.DATAFLOW);
}
}
Aggregations