Skip to content

Java: Improve performance of StaticInitializationVector. #10558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java
import semmle.code.java.dataflow.TaintTracking
import semmle.code.java.dataflow.TaintTracking2
import semmle.code.java.dataflow.DataFlow2

/**
* Holds if `array` is initialized only with constants.
Expand Down Expand Up @@ -83,14 +83,16 @@ private class ArrayUpdate extends Expr {
/**
* A config that tracks dataflow from creating an array to an operation that updates it.
*/
private class ArrayUpdateConfig extends TaintTracking2::Configuration {
private class ArrayUpdateConfig extends DataFlow2::Configuration {
ArrayUpdateConfig() { this = "ArrayUpdateConfig" }

override predicate isSource(DataFlow::Node source) {
source.asExpr() instanceof StaticByteArrayCreation
}

override predicate isSink(DataFlow::Node sink) { sink.asExpr() = any(ArrayUpdate upd).getArray() }

override predicate isBarrierOut(DataFlow::Node node) { this.isSink(node) }
}

/**
Expand Down