diff -Nru "/tmp/tmpdO65hx/hoNCbJkA_9/wala-1.3.9/After Importing WALA Into Eclipse.launch" "/tmp/tmpdO65hx/vj4dUdzt1P/wala-1.5.1/After Importing WALA Into Eclipse.launch"
--- "/tmp/tmpdO65hx/hoNCbJkA_9/wala-1.3.9/After Importing WALA Into Eclipse.launch" 1970-01-01 00:00:00.000000000 +0000
+++ "/tmp/tmpdO65hx/vj4dUdzt1P/wala-1.5.1/After Importing WALA Into Eclipse.launch" 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -Nru wala-1.3.9/appveyor.yml.disabled wala-1.5.1/appveyor.yml.disabled
--- wala-1.3.9/appveyor.yml.disabled 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/appveyor.yml.disabled 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,25 @@
+os: Visual Studio 2015
+
+install:
+ - ps: |
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
+ if (!(Test-Path -Path "C:\maven" )) {
+ (new-object System.Net.WebClient).DownloadFile(
+ 'http://www.us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip',
+ 'C:\maven-bin.zip'
+ )
+ [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
+ }
+ - cmd: SET PATH=C:\maven\apache-maven-3.3.9\bin;%JAVA_HOME%\bin;%PATH%
+ - cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
+ - cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
+
+build_script:
+ - mvn clean verify -DskipTests=true -B -q
+
+test_script:
+ - mvn clean verify -B -q
+
+cache:
+ - C:\maven\
+ - C:\Users\appveyor\.m2
\ No newline at end of file
diff -Nru wala-1.3.9/build.gradle wala-1.5.1/build.gradle
--- wala-1.3.9/build.gradle 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/build.gradle 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,186 @@
+////////////////////////////////////////////////////////////////////////
+//
+// plugin configuration must precede everything else
+//
+
+plugins {
+ id 'com.diffplug.gradle.p2.asmaven' version '3.17.0'
+ id 'com.github.hauner.jarTest' version '1.0.1' apply false
+ id 'de.undercouch.download'
+ id 'nebula.lint' version '8.3.1'
+ id 'nebula.source-jar' version '7.0.1' apply false
+ id 'maven-publish'
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// required Eclipse components
+//
+
+p2AsMaven {
+ group 'eclipse-deps', {
+ repoEclipse '4.7.2'
+ slicingOption 'latestVersionOnly', 'true'
+ iu 'org.eclipse.core.commands'
+ iu 'org.eclipse.core.contenttype'
+ iu 'org.eclipse.core.jobs'
+ iu 'org.eclipse.core.resources'
+ iu 'org.eclipse.core.runtime'
+ iu 'org.eclipse.equinox.app'
+ iu 'org.eclipse.equinox.common'
+ iu 'org.eclipse.equinox.preferences'
+ iu 'org.eclipse.jdt.core'
+ iu 'org.eclipse.jface'
+ iu 'org.eclipse.osgi'
+ iu 'org.eclipse.pde.core'
+ iu 'org.eclipse.swt'
+ iu 'org.eclipse.ui.ide'
+ iu 'org.eclipse.ui.workbench'
+ }
+ group 'wst-deps', {
+ repo 'http://download.eclipse.org/releases/oxygen'
+ slicingOption 'latestVersionOnly', 'true'
+ iu 'org.eclipse.wst.jsdt.core'
+ iu 'org.eclipse.wst.jsdt.ui'
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// common Java setup shared by multiple projects
+//
+
+group name
+version '1.5.1'
+
+subprojects { subproject ->
+ // skip generic Java setup for the few projects that have no Java code whatsoever
+ switch (subproject.name) {
+ case 'com.ibm.wala-repository':
+ case ~/.*_feature/:
+ return
+ }
+
+ apply plugin: 'java'
+ apply plugin: 'maven-publish'
+ apply plugin: 'nebula.source-jar'
+
+ version rootProject.version
+
+ repositories {
+ mavenCentral()
+ maven {
+ url "$rootProject.buildDir/p2asmaven/maven"
+ }
+ }
+
+ jar.manifest.from('META-INF/MANIFEST.MF')
+
+ publishing.publications {
+ mavenJava(MavenPublication) {
+ from components.java
+ }
+ }
+
+ task afterEclipseBuildshipImport(dependsOn: processTestResources)
+ task prepareIntelliJIDEA
+
+ test {
+ include '**/*Test.class'
+ include '**/*TestCase.class'
+ include '**/*Tests.class'
+ include '**/Test*.class'
+ exclude '**/*AndroidLibs*.class'
+
+ maxParallelForks = Integer.MAX_VALUE
+ }
+}
+
+task afterEclipseBuildshipImport(type: Exec) {
+ commandLine './revert-launchers.sh'
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// find platform-specific SWT implementations
+//
+
+def osgi_platform
+
+switch (System.getProperty('os.name')) {
+ case ~/Mac OS X/:
+ osgi_platform = 'cocoa.macosx.x86_64'
+ break
+ case ~/Windows.*/:
+ osgi_platform = 'win32.win32.x86_64'
+ break
+ case ~/Linux/:
+ osgi_platform = 'gtk.linux.x86_64'
+ break
+}
+
+System.setProperty('osgi.platform', osgi_platform)
+
+subprojects {
+ configurations.all {
+ resolutionStrategy {
+ // failOnVersionConflict()
+ dependencySubstitution {
+ substitute module('eclipse-deps:org.eclipse.swt.${osgi.platform}') with module("eclipse-deps:org.eclipse.swt.${System.getProperty('osgi.platform')}:3.+")
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// optional lint checking of Gradle scripts
+//
+
+allprojects {
+ apply plugin: 'nebula.lint'
+ gradleLint.alwaysRun = false
+ gradleLint {
+ rules = ['all-dependency']
+ excludedRules = [
+ 'duplicate-dependency-class',
+ 'transitive-duplicate-dependency-class',
+ 'unused-dependency',
+ ]
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// disable Javadoc linter until documentation is in better shape
+//
+
+allprojects {
+ tasks.withType(Javadoc) {
+ options.addBooleanOption('Xdoclint:all,-missing', true)
+ options.quiet()
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// Eclipse IDE integration
+//
+
+// workaround for
+allprojects {
+ apply plugin: 'eclipse'
+
+ eclipse.classpath.file.whenMerged {
+ entries.each {
+ if (it in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry && it.entryAttributes['gradle_used_by_scope'] == 'test')
+ it.entryAttributes['test'] = true
+ }
+ }
+}
diff -Nru wala-1.3.9/build-maven-jars.py wala-1.5.1/build-maven-jars.py
--- wala-1.3.9/build-maven-jars.py 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/build-maven-jars.py 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+# script to build jars for maven central
+import sys
+import subprocess
+import os
+
+# action should be either 'install' (for local test)
+# or 'deploy' (for deployment to maven central).
+# if current version is SNAPSHOT, will only be deployed
+# to sonatype's staging servers. otherwise, will be
+# deployed to maven central
+action = sys.argv[1]
+
+# projects for which we should build jars, in order
+# will be prefixed with 'com.ibm.wala.'
+projects = [
+ "util",
+ "shrike",
+ "core",
+ "cast",
+ "cast.java",
+ "cast.java.ecj",
+ "cast.js",
+ "cast.js.rhino",
+ "dalvik",
+ "scandroid"
+ ]
+
+for proj in projects:
+ full_proj = "com.ibm.wala." + proj
+ print(full_proj)
+ os.chdir(full_proj)
+ mvnCmd = "mvn -f mvncentral.xml clean " + action
+ try:
+ subprocess.check_output(mvnCmd, shell=True)
+ except subprocess.CalledProcessError as e:
+ print("OUTPUT")
+ print(e.output)
+ raise
+ os.chdir("..")
+
diff -Nru wala-1.3.9/buildSrc/build.gradle wala-1.5.1/buildSrc/build.gradle
--- wala-1.3.9/buildSrc/build.gradle 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/buildSrc/build.gradle 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,7 @@
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile 'de.undercouch:gradle-download-task:3.4.3'
+}
diff -Nru wala-1.3.9/buildSrc/.gitignore wala-1.5.1/buildSrc/.gitignore
--- wala-1.3.9/buildSrc/.gitignore 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/buildSrc/.gitignore 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1 @@
+/.gradle/
diff -Nru wala-1.3.9/buildSrc/src/main/groovy/package-list.groovy wala-1.5.1/buildSrc/src/main/groovy/package-list.groovy
--- wala-1.3.9/buildSrc/src/main/groovy/package-list.groovy 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/buildSrc/src/main/groovy/package-list.groovy 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,31 @@
+import org.gradle.api.tasks.*
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// create a Javadoc-style "package-list" file
+//
+
+@CacheableTask
+class CreatePackageList extends org.gradle.api.DefaultTask {
+
+ @PathSensitive(PathSensitivity.RELATIVE)
+ @Input Object sourceSet
+
+ @OutputFile File packageList = new File("$temporaryDir/package-list")
+
+ @TaskAction
+ def create() {
+ sourceSet.sourceCollections.collect { collection ->
+ def sourceRoot = collection.tree.dir.toPath()
+ collection.collect { source ->
+ def javaSourceFilePath = source.toPath()
+ def parentPath = javaSourceFilePath.parent
+ def relativePath = sourceRoot.relativize(parentPath)
+ relativePath.toString().replace(File.separator, '.')
+ }
+ }.flatten().sort().unique().each {
+ packageList << "$it\n"
+ }
+ }
+}
diff -Nru wala-1.3.9/buildSrc/src/main/groovy/verified-download.groovy wala-1.5.1/buildSrc/src/main/groovy/verified-download.groovy
--- wala-1.3.9/buildSrc/src/main/groovy/verified-download.groovy 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/buildSrc/src/main/groovy/verified-download.groovy 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,53 @@
+import org.gradle.api.tasks.*
+
+
+////////////////////////////////////////////////////////////////////////
+//
+// download and use checksum to verify that we got what we expected
+//
+
+@CacheableTask
+class VerifiedDownload extends org.gradle.api.DefaultTask {
+
+ // URL of resource to download
+ def @Input src
+
+ // expected checksum of resource as hex digits
+ def @Input checksum
+
+ // algorithm to use for computing checksum
+ def @Input algorithm = 'MD5'
+
+ // whether to use ETag for selective downloading
+ def @Input useETag = true
+
+ // local file into which resource should be saved
+ def @OutputFile dest
+
+ File getDest() {
+ return project.file(dest)
+ }
+
+ VerifiedDownload() {
+ outputs.upToDateWhen {
+ getDest().exists()
+ }
+ }
+
+ @TaskAction
+ downloadAndVerify() {
+ def destFile = getDest()
+ project.download {
+ src this.src
+ dest destFile
+ overwrite true
+ onlyIfModified true
+ useETag this.useETag
+ }
+ project.verifyChecksum {
+ src destFile
+ algorithm this.algorithm
+ checksum this.checksum
+ }
+ }
+}
diff -Nru wala-1.3.9/change-version.py wala-1.5.1/change-version.py
--- wala-1.3.9/change-version.py 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/change-version.py 2019-01-29 17:08:39.000000000 +0000
@@ -5,6 +5,10 @@
import sys
import subprocess
+def runAndPrint(cmd):
+ print cmd
+ subprocess.check_output(cmd, shell=True)
+
oldVersion = sys.argv[1]
newVersion = sys.argv[2]
@@ -13,13 +17,11 @@
oldVersion = oldVersion.replace(".", "\.")
newVersion = newVersion.replace(".", "\.")
-cleanCmd = "mvn clean -q"
-print cleanCmd
-subprocess.check_output(cleanCmd, shell=True)
-
-xmlCmd = "find -E ./ -regex \".*(pom|mvncentral)\.xml\" | xargs -n 1 perl -pi -e \'s/" + oldVersion + "/" + newVersion + "/g\'"
-print xmlCmd
-subprocess.check_output(xmlCmd, shell=True)
+runAndPrint("mvn clean -q")
+
+runAndPrint("find -E ./ -regex \".*(pom|mvncentral)\.xml\" | xargs -n 1 perl -pi -e \'s/" + oldVersion + "/" + newVersion + "/g\'")
+
+runAndPrint("perl -pi -e \'s/" + oldVersion + "/" + newVersion + "/g\' build.gradle")
oldIsSnapshot = oldVersion.endswith("SNAPSHOT")
newIsSnapShot = newVersion.endswith("SNAPSHOT")
@@ -27,10 +29,7 @@
bundleOld = oldVersion if not oldIsSnapshot else oldVersion.replace("-SNAPSHOT","\.qualifier")
bundleNew = newVersion if not newIsSnapShot else newVersion.replace("-SNAPSHOT","\.qualifier")
-otherCmd = "find -E ./ -regex \".*(MANIFEST\.MF|feature\.xml)\" | xargs -n 1 perl -pi -e \'s/" + bundleOld + "/" + bundleNew + "/g\'"
-
-print otherCmd
-subprocess.check_output(otherCmd, shell=True)
+runAndPrint("find -E ./ -regex \".*(MANIFEST\.MF|feature\.xml)\" | xargs -n 1 perl -pi -e \'s/" + bundleOld + "/" + bundleNew + "/g\'")
print "done"
diff -Nru wala-1.3.9/com.ibm.wala.cast/build.gradle wala-1.5.1/com.ibm.wala.cast/build.gradle
--- wala-1.3.9/com.ibm.wala.cast/build.gradle 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/build.gradle 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,106 @@
+plugins {
+ id 'cpp'
+ id 'eclipse'
+}
+
+eclipse.project.natures 'org.eclipse.pde.PluginNature'
+
+sourceSets.main.java.srcDirs = ['source/java']
+
+dependencies {
+ compile(
+ 'commons-io:commons-io:2.4',
+ project(':com.ibm.wala.core'),
+ project(':com.ibm.wala.shrike'),
+ project(':com.ibm.wala.util'),
+ )
+}
+
+javadoc {
+ def js = ':com.ibm.wala.cast.js'
+ evaluationDependsOn(js)
+
+ dependsOn "$js:compileJava"
+ js = project(js)
+ doFirst {
+ classpath += files js.compileJava
+ }
+
+ dependsOn js.createPackageList
+ options.linksOffline js.javadoc.outputDirectory.path, js.createPackageList.packageList.parent
+}
+
+def currentJavaHome = org.gradle.internal.jvm.Jvm.current().javaHome
+
+model {
+ repositories {
+ libs(PrebuiltLibraries) {
+ jdk {
+ def jniIncludeDir = "$currentJavaHome/include"
+ headers.srcDir jniIncludeDir
+ binaries.withType(SharedLibraryBinary) {
+ switch (targetPlatform.operatingSystem.name) {
+ case 'linux':
+ headers.srcDirs "$jniIncludeDir/linux"
+ def subdirs = ['jre/lib/amd64/server', 'lib/amd64/server', 'lib/server']
+ def candidates = subdirs.collect { file("$currentJavaHome/$it/libjvm.so") }
+ sharedLibraryLinkFile = candidates.find { it.exists() }
+ break
+ case 'osx':
+ headers.srcDirs "$jniIncludeDir/darwin"
+ sharedLibraryLinkFile = file("$currentJavaHome/jre/lib/server/libjvm.dylib")
+ break
+ case 'windows':
+ headers.srcDirs "$jniIncludeDir/win32"
+ sharedLibraryLinkFile = file("$currentJavaHome/lib/jvm.lib")
+ break
+ }
+ }
+ }
+ }
+ }
+
+ components {
+ cast(NativeLibrarySpec) {
+ sources.cpp {
+ def cSourceDir = 'source/c'
+ source {
+ srcDirs = ["$cSourceDir/jni"]
+ include '*.cpp'
+ }
+ exportedHeaders.srcDirs = ["$cSourceDir/include"]
+ lib library: 'jdk'
+ }
+
+ binaries {
+ withType(StaticLibraryBinarySpec) {
+ buildable = false
+ }
+ withType(SharedLibraryBinarySpec) {
+ def libDir = $.repositories['libs'].resolveLibrary('jdk')
+ .binaries.withType(SharedLibraryBinary)
+ .find { it.targetPlatform.name == targetPlatform.name }
+ .sharedLibraryLinkFile.parent
+ linker.args "-Wl,-rpath,$libDir"
+ if (targetPlatform.operatingSystem.name == 'osx') {
+ linker.args "-Wl,-install_name,@rpath/$sharedLibraryFile.name"
+ }
+ }
+ }
+ }
+ }
+}
+
+// TODO: if we eventually stop supporting Maven, then we may be able
+// to discard the "copyJarsIntoLib" task and the corresponding lines
+// in "META-INF/MANIFEST.MF" and "build.properties"
+
+task copyJarsIntoLib(type: Sync) {
+ def commonsIoJar = configurations.runtimeClasspath.files[0]
+ assert commonsIoJar.name.startsWith('commons-io-')
+ from commonsIoJar
+ into 'lib'
+}
+
+assemble.dependsOn copyJarsIntoLib
+clean.dependsOn cleanCopyJarsIntoLib
diff -Nru wala-1.3.9/com.ibm.wala.cast/build.properties wala-1.5.1/com.ibm.wala.cast/build.properties
--- wala-1.3.9/com.ibm.wala.cast/build.properties 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/build.properties 2019-01-29 17:08:39.000000000 +0000
@@ -1,5 +1,7 @@
source.. = source/java/
-output.. = bin/
+output.. = bin/main
bin.includes = META-INF/,\
- lib/commons-io-2.4.jar,\
- .
+ lib/commons-io-2.4.jar,\
+ .,\
+ OSGI-INF/
+javacProjectSettings = true
diff -Nru wala-1.3.9/com.ibm.wala.cast/build.xml wala-1.5.1/com.ibm.wala.cast/build.xml
--- wala-1.3.9/com.ibm.wala.cast/build.xml 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/build.xml 1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -Nru wala-1.3.9/com.ibm.wala.cast/.classpath wala-1.5.1/com.ibm.wala.cast/.classpath
--- wala-1.3.9/com.ibm.wala.cast/.classpath 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/.classpath 1970-01-01 00:00:00.000000000 +0000
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff -Nru wala-1.3.9/com.ibm.wala.cast/.cvsignore wala-1.5.1/com.ibm.wala.cast/.cvsignore
--- wala-1.3.9/com.ibm.wala.cast/.cvsignore 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/.cvsignore 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-bin
-domo-trace.txt*
diff -Nru "/tmp/tmpdO65hx/hoNCbJkA_9/wala-1.3.9/com.ibm.wala.cast/.externalToolBuilders/make WALA.CAst.launch" "/tmp/tmpdO65hx/vj4dUdzt1P/wala-1.5.1/com.ibm.wala.cast/.externalToolBuilders/make WALA.CAst.launch"
--- "/tmp/tmpdO65hx/hoNCbJkA_9/wala-1.3.9/com.ibm.wala.cast/.externalToolBuilders/make WALA.CAst.launch" 2016-05-10 12:59:26.000000000 +0000
+++ "/tmp/tmpdO65hx/vj4dUdzt1P/wala-1.5.1/com.ibm.wala.cast/.externalToolBuilders/make WALA.CAst.launch" 1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff -Nru wala-1.3.9/com.ibm.wala.cast/META-INF/MANIFEST.MF wala-1.5.1/com.ibm.wala.cast/META-INF/MANIFEST.MF
--- wala-1.3.9/com.ibm.wala.cast/META-INF/MANIFEST.MF 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/META-INF/MANIFEST.MF 2019-01-29 17:08:39.000000000 +0000
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: WALA CAst core Plug-in
+Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.ibm.wala.cast
-Bundle-Version: 1.3.9
-Bundle-Vendor: IBM
+Bundle-Version: 1.5.1
+Bundle-Vendor: %Bundle-Vendor
Require-Bundle: com.ibm.wala.core,
com.ibm.wala.shrike
Bundle-ActivationPolicy: lazy
@@ -28,5 +28,6 @@
com.ibm.wala.cast.util,
org.apache.commons.io,
org.apache.commons.io.input
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: com.ibm.wala.cast
diff -Nru wala-1.3.9/com.ibm.wala.cast/mvncentral.xml wala-1.5.1/com.ibm.wala.cast/mvncentral.xml
--- wala-1.3.9/com.ibm.wala.cast/mvncentral.xml 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/mvncentral.xml 2019-01-29 17:08:39.000000000 +0000
@@ -5,7 +5,7 @@
4.0.0
com.ibm.wala
com.ibm.wala.cast
- 1.3.9
+ 1.5.1
jar
WALA CAst
WALA Common AST core library
@@ -44,13 +44,18 @@
com.ibm.wala
+ com.ibm.wala.util
+ 1.5.1
+
+
+ com.ibm.wala
com.ibm.wala.core
- 1.3.9
+ 1.5.1
com.ibm.wala
com.ibm.wala.shrike
- 1.3.9
+ 1.5.1
commons-io
@@ -65,6 +70,18 @@
https://oss.sonatype.org/content/repositories/snapshots/
+
+
+
+ jdk18
+
+ 1.8
+
+
+ -Xdoclint:none
+
+
+
${src.dir}
@@ -74,8 +91,8 @@
maven-compiler-plugin
3.2
-
- 1.7
+
+ 1.8
@@ -107,6 +124,9 @@
org.apache.maven.plugins
maven-javadoc-plugin
+
+ ${javadoc.options}
+
2.9.1
diff -Nru wala-1.3.9/com.ibm.wala.cast/OSGI-INF/l10n/bundle.properties wala-1.5.1/com.ibm.wala.cast/OSGI-INF/l10n/bundle.properties
--- wala-1.3.9/com.ibm.wala.cast/OSGI-INF/l10n/bundle.properties 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/OSGI-INF/l10n/bundle.properties 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,3 @@
+#Properties file for com.ibm.wala.cast
+Bundle-Vendor = IBM
+Bundle-Name = WALA CAst core Plug-in
\ No newline at end of file
diff -Nru wala-1.3.9/com.ibm.wala.cast/pom.xml wala-1.5.1/com.ibm.wala.cast/pom.xml
--- wala-1.3.9/com.ibm.wala.cast/pom.xml 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/pom.xml 2019-01-29 17:08:39.000000000 +0000
@@ -5,12 +5,32 @@
WALA
com.ibm.wala
- 1.3.9
+ 1.5.1
com.ibm.wala.cast
eclipse-plugin
-
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.6.0
+
+
+ compile
+
+ bash
+
+ ${basedir}/source/c/cbuild.sh
+
+ ${basedir}/source/c
+
+
+ exec
+
+
+
+
maven-dependency-plugin
diff -Nru wala-1.3.9/com.ibm.wala.cast/.project wala-1.5.1/com.ibm.wala.cast/.project
--- wala-1.3.9/com.ibm.wala.cast/.project 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/.project 1970-01-01 00:00:00.000000000 +0000
@@ -1,38 +0,0 @@
-
-
- com.ibm.wala.cast
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
- org.eclipse.ui.externaltools.ExternalToolBuilder
- full,incremental,
-
-
- LaunchConfigHandle
- <project>/.externalToolBuilders/make WALA.CAst.launch
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
diff -Nru wala-1.3.9/com.ibm.wala.cast/.settings/org.eclipse.jdt.core.prefs wala-1.5.1/com.ibm.wala.cast/.settings/org.eclipse.jdt.core.prefs
--- wala-1.3.9/com.ibm.wala.cast/.settings/org.eclipse.jdt.core.prefs 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/.settings/org.eclipse.jdt.core.prefs 2019-01-29 17:08:39.000000000 +0000
@@ -1,78 +1,126 @@
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=error
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=error
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
+org.eclipse.jdt.core.compiler.problem.unusedParameter=error
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff -Nru wala-1.3.9/com.ibm.wala.cast/.settings/org.eclipse.pde.prefs wala-1.5.1/com.ibm.wala.cast/.settings/org.eclipse.pde.prefs
--- wala-1.3.9/com.ibm.wala.cast/.settings/org.eclipse.pde.prefs 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/.settings/org.eclipse.pde.prefs 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=0
+compilers.f.unresolved-plugins=0
+compilers.incompatible-environment=0
+compilers.p.build=2
+compilers.p.build.bin.includes=2
+compilers.p.build.encodings=0
+compilers.p.build.java.compiler=0
+compilers.p.build.java.compliance=0
+compilers.p.build.missing.output=0
+compilers.p.build.output.library=2
+compilers.p.build.source.library=2
+compilers.p.build.src.includes=0
+compilers.p.deprecated=0
+compilers.p.discouraged-class=0
+compilers.p.internal=0
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=0
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=2
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=0
+eclipse.preferences.version=1
diff -Nru wala-1.3.9/com.ibm.wala.cast/.settings/org.eclipse.wst.validation.prefs wala-1.5.1/com.ibm.wala.cast/.settings/org.eclipse.wst.validation.prefs
--- wala-1.3.9/com.ibm.wala.cast/.settings/org.eclipse.wst.validation.prefs 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/.settings/org.eclipse.wst.validation.prefs 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,10 @@
+DELEGATES_PREFERENCE=delegateValidatorList
+USER_BUILD_PREFERENCE=enabledBuildValidatorList
+USER_MANUAL_PREFERENCE=enabledManualValidatorList
+USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.700.v201610061600
+eclipse.preferences.version=1
+override=true
+suspend=false
+vals/org.eclipse.wst.html.core.HTMLValidator/groups=0107include06111contentType136org.eclipse.wst.html.core.htmlsourceT07fileext04htmlF07fileext05xhtmlF07fileext03htmF07fileext04htplF07fileext03wmlF0107exclude0104file139target/site/dependency-convergence.htmlT03
+vals/org.eclipse.wst.xml.core.xml/groups=0107include05111contentType128org.eclipse.core.runtime.xmlT111contentType134org.eclipse.wst.xml.core.xmlsourceT111contentType134org.eclipse.wst.xml.core.xslsourceT111contentType134org.eclipse.jst.jsp.core.tldsourceT07fileext03xmlF0107exclude07113projectNature134org.eclipse.jst.j2ee.ejb.EJBNature113projectNature130org.eclipse.jst.j2ee.EARNature04file08.projectT0104file110.classpathT0104file110.settings/T0204file122target/p2artifacts.xmlT0304file120target/p2content.xmlT03
+vf.version=3
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/cbuild.sh wala-1.5.1/com.ibm.wala.cast/source/c/cbuild.sh
--- wala-1.3.9/com.ibm.wala.cast/source/c/cbuild.sh 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/cbuild.sh 2019-01-29 17:08:39.000000000 +0000
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
if (uname | grep -i "cygwin"); then
# This should be the default for most of cases;
@@ -8,5 +8,9 @@
cmd.exe /c "call \"$MSVC\\vcvarsall.bat\" $ARCH && make"
else
- make
+ make --quiet
fi
+
+# Local variables:
+# eval: (smie-config-local '((8 :after "else" 2) (8 :elem basic 2)))
+# End:
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/.cvsignore wala-1.5.1/com.ibm.wala.cast/source/c/.cvsignore
--- wala-1.3.9/com.ibm.wala.cast/source/c/.cvsignore 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/.cvsignore 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-Makefile.configuration
-CAstWrapper.lib
-CAstWrapper.exp
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/include/cast_constants.h wala-1.5.1/com.ibm.wala.cast/source/c/include/cast_constants.h
--- wala-1.3.9/com.ibm.wala.cast/source/c/include/cast_constants.h 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/include/cast_constants.h 2019-01-29 17:08:39.000000000 +0000
@@ -87,6 +87,13 @@
_CAstNodeType(INCLUDE)
_CAstNodeType(NAMED_ENTITY_REF);
_CAstNodeType(MACRO_VAR);
+_CAstNodeType(COMPREHENSION_EXPR);
+_CAstNodeType(NEW_ENCLOSING);
+_CAstNodeType(NARY_EXPR);
+_CAstNodeType(SPECIAL_PARENT_SCOPE);
+_CAstNodeType(YIELD_STMT);
+_CAstNodeType(FORIN_LOOP);
+_CAstNodeType(TYPE_LITERAL_EXPR);
#undef _CODE_CONSTANTS
#undef _CPP_CONSTANTS
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/include/CAstWrapper.h wala-1.5.1/com.ibm.wala.cast/source/c/include/CAstWrapper.h
--- wala-1.3.9/com.ibm.wala.cast/source/c/include/CAstWrapper.h 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/include/CAstWrapper.h 2019-01-29 17:08:39.000000000 +0000
@@ -4,6 +4,7 @@
#include
#include "jni.h"
#include "Exceptions.h"
+#include "launch.h"
using namespace std;
@@ -53,6 +54,7 @@
jclass CAstInterface;
jclass CAstPrinter;
jclass CAstSymbol;
+ jclass CAstType;
jclass NativeEntity;
jclass NativeClassEntity;
jclass NativeCodeEntity;
@@ -103,6 +105,9 @@
jmethodID codeSetLabelledGotoTarget;
jobject callReference;
+ static bool initialized;
+ static void initialize(JNIEnv *java_env);
+
public:
#define _INCLUDE_CONSTANTS
@@ -121,6 +126,8 @@
CAstWrapper(JNIEnv *env, Exceptions &ex, jobject Ast);
+ virtual ~CAstWrapper() { }
+
void assertIsCAstNode(jobject, int);
jobject makeNode(int);
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/include/Exceptions.h wala-1.5.1/com.ibm.wala.cast/source/c/include/Exceptions.h
--- wala-1.3.9/com.ibm.wala.cast/source/c/include/Exceptions.h 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/include/Exceptions.h 2019-01-29 17:08:39.000000000 +0000
@@ -37,7 +37,14 @@
#define CATCH() \
} \
-} \
+}
+
+#define START_CATCH_BLOCK() \
+ } else {
+
+#define END_CATCH_BLOCK() \
+ } \
+}
#define THROW(CPP_EXP_NAME, MESSAGE) \
(CPP_EXP_NAME).throwException(__FILE__, __LINE__, MESSAGE)
@@ -45,6 +52,11 @@
#define THROW_ANY_EXCEPTION(CPP_EXP_NAME) \
(CPP_EXP_NAME).throwAnyException(__FILE__, __LINE__)
+#define NULL_CHECK(cpp_exp_name, c_expr) \
+ if ((c_expr) == NULL) { \
+ (CPP_EXP_NAME).throwException(__FILE__, __LINE__, "unexpected null value"); \
+}
+
#if __WIN32__
#ifdef BUILD_CAST_DLL
#define DLLEXPORT __declspec(dllexport)
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/include/launch.h wala-1.5.1/com.ibm.wala.cast/source/c/include/launch.h
--- wala-1.3.9/com.ibm.wala.cast/source/c/include/launch.h 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/include/launch.h 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,9 @@
+#ifndef _CAST_LAUNCH_H
+#define _CAST_LAUNCH_H
+
+#include "jni.h"
+
+extern JNIEnv *launch_jvm(char *);
+extern void kill();
+
+#endif
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/jni/CAstWrapper.cpp wala-1.5.1/com.ibm.wala.cast/source/c/jni/CAstWrapper.cpp
--- wala-1.3.9/com.ibm.wala.cast/source/c/jni/CAstWrapper.cpp 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/jni/CAstWrapper.cpp 2019-01-29 17:08:39.000000000 +0000
@@ -1,20 +1,18 @@
-#include
-
-#include
-
-#include
-#include
#include
-
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__APPLE__)
-#define strndup(s,n) strdup(s)
-#endif
+#include
+#include
+#include
+#include
+#include
#define __SIG( __nm ) "L" __nm ";"
#define __CTN "com/ibm/wala/cast/tree/CAst"
#define __CTS __SIG( __CTN )
+#define __CTI "com/ibm/wala/cast/tree/impl/CAstImpl"
+#define __CII __SIG( __CTI )
+
#define __CEN "com/ibm/wala/cast/tree/CAstEntity"
#define __CES __SIG( __CEN )
@@ -66,6 +64,11 @@
CAstWrapper::CAstWrapper(JNIEnv *env, Exceptions &ex, jobject xlator)
: java_ex(ex), env(env), xlator(xlator)
{
+ if (!initialized) {
+ initialized = true;
+ initialize(env);
+ }
+
this->CAstNode = env->FindClass( __CNN );
this->CAstInterface = env->FindClass( __CTN );
this->HashSet = env->FindClass("java/util/HashSet");
@@ -74,11 +77,15 @@
env->FindClass("com/ibm/wala/cast/ir/translator/NativeBridge");
this->NativeTranslatorToCAst =
env->FindClass("com/ibm/wala/cast/ir/translator/NativeTranslatorToCAst");
+ THROW_ANY_EXCEPTION(java_ex);
jfieldID castFieldID = env->GetFieldID(NativeBridge, "Ast", "Lcom/ibm/wala/cast/tree/CAst;");
+ THROW_ANY_EXCEPTION(java_ex);
this->Ast = env->GetObjectField(xlator, castFieldID);
+ THROW_ANY_EXCEPTION(java_ex);
jclass xlatorCls = env->FindClass( XlatorCls );
+ THROW_ANY_EXCEPTION(java_ex);
this->_makeLocation = env->GetMethodID(xlatorCls, "makeLocation", "(IIII)Lcom/ibm/wala/cast/tree/CAstSourcePositionMap$Position;");
THROW_ANY_EXCEPTION(java_ex);
@@ -206,21 +213,21 @@
THROW_ANY_EXCEPTION(java_ex);
this->_getEntityName = env->GetMethodID(castEntity, "getName", "()Ljava/lang/String;");
+ CAstType = env->FindClass("com/ibm/wala/cast/tree/CAstType");
CAstSymbol = env->FindClass("com/ibm/wala/cast/tree/impl/CAstSymbolImpl");
THROW_ANY_EXCEPTION(java_ex);
this->castSymbolInit1 =
- env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;)V");
+ env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;Lcom/ibm/wala/cast/tree/CAstType;)V");
THROW_ANY_EXCEPTION(java_ex);
this->castSymbolInit2 =
- env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;Z)V");
+ env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;Lcom/ibm/wala/cast/tree/CAstType;Z)V");
THROW_ANY_EXCEPTION(java_ex);
this->castSymbolInit3 =
- env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;ZZ)V");
+ env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;Lcom/ibm/wala/cast/tree/CAstType;ZZ)V");
THROW_ANY_EXCEPTION(java_ex);
this->castSymbolInit4 =
- env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;ZZLjava/lang/Object;)V");
+ env->GetMethodID(CAstSymbol, "", "(Ljava/lang/String;Lcom/ibm/wala/cast/tree/CAstType;ZZLjava/lang/Object;)V");
THROW_ANY_EXCEPTION(java_ex);
-
}
#define _CPP_CONSTANTS
@@ -252,16 +259,13 @@
jstring jclsstr = (jstring)env->CallObjectMethod(cls, toString);
const char *cclsstr = env->GetStringUTFChars(jclsstr, NULL);
-#if defined(_MSC_VER)
- char* buf = (char*)_alloca(strlen(cstr) + strlen(cclsstr) + 100);
-#else
- char buf[ strlen(cstr) + strlen(cclsstr) + 100 ];
-#endif
- sprintf(buf, "argument %d (%s of type %s) is not a CAstNode\n", n, cstr, cclsstr);
+ ostringstream formatter;
+ formatter << "argument " << n << " (" << cstr << " of type " << cclsstr << ") is not a CAstNode\n";
+ const string message = formatter.str();
env->ReleaseStringUTFChars(jstr, cstr);
env->ReleaseStringUTFChars(jclsstr, cclsstr);
- THROW(java_ex, buf);
+ THROW(java_ex, message.c_str());
}
}
@@ -405,14 +409,12 @@
return r;
}
-jobject CAstWrapper::makeConstant(const char *strData) {
- return makeConstant(strData, strlen(strData));
+jobject CAstWrapper::makeConstant(const char *strData, int strLen) {
+ return makeConstant(string(strData, strLen).c_str());
}
-jobject CAstWrapper::makeConstant(const char *strData, int strLen) {
- char *safeData = strndup(strData, strLen);
- jobject val = env->NewStringUTF( safeData );
- delete safeData;
+jobject CAstWrapper::makeConstant(const char *strData) {
+ jobject val = env->NewStringUTF( strData );
jobject r = env->CallObjectMethod(Ast, makeObject, val);
THROW_ANY_EXCEPTION(java_ex);
LOG(r);
@@ -576,9 +578,7 @@
}
jobject CAstWrapper::makeSymbol(const char *name) {
- char *safeName = strndup(name, strlen(name)+1);
- jobject val = env->NewStringUTF( safeName );
- delete safeName;
+ jobject val = env->NewStringUTF( name );
jobject s = env->NewObject(CAstSymbol, castSymbolInit1, val);
THROW_ANY_EXCEPTION(java_ex);
@@ -588,9 +588,7 @@
}
jobject CAstWrapper::makeSymbol(const char *name, bool isFinal) {
- char *safeName = strndup(name, strlen(name)+1);
- jobject val = env->NewStringUTF( safeName );
- delete safeName;
+ jobject val = env->NewStringUTF( name );
THROW_ANY_EXCEPTION(java_ex);
@@ -602,9 +600,7 @@
jobject
CAstWrapper::makeSymbol(const char *name, bool isFinal, bool isCaseInsensitive)
{
- char *safeName = strndup(name, strlen(name)+1);
- jobject val = env->NewStringUTF( safeName );
- delete safeName;
+ jobject val = env->NewStringUTF( name );
jobject s = env->NewObject(CAstSymbol, castSymbolInit3, val, isFinal, isCaseInsensitive);
THROW_ANY_EXCEPTION(java_ex);
@@ -619,9 +615,7 @@
bool isCaseInsensitive,
jobject defaultValue)
{
- char *safeName = strndup(name, strlen(name)+1);
- jobject val = env->NewStringUTF( safeName );
- delete safeName;
+ jobject val = env->NewStringUTF( name );
jobject s = env->NewObject(CAstSymbol, castSymbolInit4, val, isFinal, isCaseInsensitive, defaultValue);
THROW_ANY_EXCEPTION(java_ex);
@@ -691,10 +685,8 @@
}
jobject CAstWrapper::makeGlobalEntity(char *name, jobject type, list *modifiers) {
- char *safeData = strdup(name);
- jobject val = env->NewStringUTF( safeData );
+ jobject val = env->NewStringUTF( name );
THROW_ANY_EXCEPTION(java_ex);
- delete safeData;
jobject entity = env->NewObject(NativeGlobalEntity, globalEntityInit, val, type, makeSet(modifiers));
THROW_ANY_EXCEPTION(java_ex);
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/jni/Exceptions.cpp wala-1.5.1/com.ibm.wala.cast/source/c/jni/Exceptions.cpp
--- wala-1.3.9/com.ibm.wala.cast/source/c/jni/Exceptions.cpp 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/jni/Exceptions.cpp 2019-01-29 17:08:39.000000000 +0000
@@ -1,11 +1,12 @@
+#include
#include
-#include
-#include
+#include
+#include
#include "Exceptions.h"
-#ifdef _MSC_VER
-#include
-#endif
+using std::ostringstream;
+using std::string;
+
Exceptions::Exceptions(JNIEnv *java_env, jmp_buf& c_env) :
_java_env(java_env),
@@ -23,14 +24,18 @@
if (_java_env->ExceptionCheck()) throwException(file_name, line_number);
}
+static void formatExceptionMessage(ostringstream &formatter, const char *file_name, int line_number) {
+ formatter << "exception at " << file_name << ':' << line_number;
+}
+
void Exceptions::throwException(const char *file_name, int line_number) {
jthrowable real_ex = _java_env->ExceptionOccurred();
_java_env->ExceptionClear();
- char msg[strlen(file_name) + 1024];
- memset(msg, 0, strlen(file_name) + 1024);
- sprintf(msg, "exception at %s:%d", file_name, line_number);
- jstring java_message = _java_env->NewStringUTF(msg);
+ ostringstream formatter;
+ formatExceptionMessage(formatter, file_name, line_number);
+ string message = formatter.str();
+ jstring java_message = _java_env->NewStringUTF(message.c_str());
jthrowable ex = (jthrowable)
_java_env->NewObject(_jre, _wrapper_ctr, java_message, real_ex);
@@ -47,10 +52,11 @@
void
Exceptions::throwException(const char *file_name, int line_number, const char *c_message) {
- char msg[strlen(file_name) + strlen(c_message) + 1024];
- memset(msg, 0, strlen(file_name) + strlen(c_message) + 1024);
- sprintf(msg, "exception at %s:%d: %s", file_name, line_number, c_message);
- jstring java_message = _java_env->NewStringUTF(msg);
+ ostringstream formatter;
+ formatExceptionMessage(formatter, file_name, line_number);
+ formatter << ": " << c_message;
+ string message = formatter.str();
+ jstring java_message = _java_env->NewStringUTF(message.c_str());
jthrowable ex = (jthrowable)_java_env->NewObject(_jre, _ctr, java_message);
_java_env->Throw(ex);
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/jni/Java_com_ibm_wala_cast_ir_translator_NativeBridge.cpp wala-1.5.1/com.ibm.wala.cast/source/c/jni/Java_com_ibm_wala_cast_ir_translator_NativeBridge.cpp
--- wala-1.3.9/com.ibm.wala.cast/source/c/jni/Java_com_ibm_wala_cast_ir_translator_NativeBridge.cpp 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/jni/Java_com_ibm_wala_cast_ir_translator_NativeBridge.cpp 2019-01-29 17:08:39.000000000 +0000
@@ -3,15 +3,10 @@
#include "CAstWrapper.h"
#include "Exceptions.h"
-#include "com_ibm_wala_cast_ir_translator_NativeBridge.h"
-extern "C" {
+bool CAstWrapper::initialized = false;
-JNIEXPORT void JNICALL
-Java_com_ibm_wala_cast_ir_translator_NativeBridge_initialize(
- JNIEnv *env,
- jclass cls)
-{
+void CAstWrapper::initialize(JNIEnv *env) {
TRY(exp, env)
jclass CAstNode = env->FindClass( "com/ibm/wala/cast/tree/CAstNode" );
@@ -38,4 +33,3 @@
CATCH()
}
-}
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/jni/launch.cpp wala-1.5.1/com.ibm.wala.cast/source/c/jni/launch.cpp
--- wala-1.3.9/com.ibm.wala.cast/source/c/jni/launch.cpp 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/jni/launch.cpp 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,47 @@
+#include
+ #include
+#include
+#include "Exceptions.h"
+#include "CAstWrapper.h"
+#include "launch.h"
+
+JavaVM *javaVM;
+
+static string javaPathFlag(const string &kind, const char *classpath) {
+ return "-Djava." + kind + ".path=" + classpath;
+}
+
+JNIEnv *launch_jvm(char *classpath) {
+ JavaVMOption jvmopt[2];
+
+ string buf_jcp = javaPathFlag("class", classpath);
+ jvmopt[0].optionString = const_cast(buf_jcp.c_str());
+
+ string buf_jlp = javaPathFlag("library", classpath);
+ jvmopt[1].optionString = const_cast(buf_jlp.c_str());
+
+ JavaVMInitArgs vmArgs;
+ vmArgs.version = JNI_VERSION_1_8;
+ vmArgs.nOptions = 2;
+ vmArgs.options = jvmopt;
+ vmArgs.ignoreUnrecognized = JNI_TRUE;
+
+ // Create the JVM
+ JNIEnv *jniEnv;
+ long flag = JNI_CreateJavaVM(&javaVM, (void**)
+ &jniEnv, &vmArgs);
+ if (flag == JNI_ERR) {
+ fprintf(stderr, "Error creating VM. Exiting...\n");
+ return NULL;
+ }
+
+ return jniEnv;
+}
+
+void kill() {
+ javaVM->DestroyJavaVM();
+}
+
+// Local variables:
+// c-basic-offset: 3
+// End:
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/Makefile wala-1.5.1/com.ibm.wala.cast/source/c/Makefile
--- wala-1.3.9/com.ibm.wala.cast/source/c/Makefile 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/Makefile 2019-01-29 17:08:39.000000000 +0000
@@ -1,87 +1,32 @@
include Makefile.configuration
-#
-# in theory, these definitions should not need to be changed
-#
-
-ifeq (x$(PLATFORM),x)
- PLATFORM=$(shell uname -s)
-endif
-
-C_GENERATED=$(DOMO_AST_BIN)libcast/
-
-JAVAH_GENERATED=$(C_GENERATED)
-ifeq ($(PLATFORM),windows)
- CC=i686-mingw32-g++
-else
- CC=g++
-endif
-
-vpath %.cpp jni
-
-JAVA_INCLUDES = -I$(JAVA_SDK)include
-
-CAPA_INCLUDE_DIR = include/
-CAPA_INCLUDES = -I$(CAPA_INCLUDE_DIR) -I$(C_GENERATED)
-
-CAPA_JNI_BRIDGE_HEADER = $(C_GENERATED)com_ibm_wala_cast_ir_translator_NativeBridge.h
-CAPA_JNI_XLATOR_HEADER = $(C_GENERATED)com_ibm_wala_cast_ir_translator_NativeTranslatorToCAst.h
-CAPA_JNI_HEADERS = $(CAPA_JNI_BRIDGE_HEADER) $(CAPA_JNI_XLATOR_HEADER)
-
-INCLUDES = $(CAPA_INCLUDES) $(JAVA_INCLUDES)
-
-CAPA_SOURCES = $(notdir $(wildcard jni/*.cpp))
-CAPA_OBJECTS = $(patsubst %.cpp,$(C_GENERATED)%.o,$(CAPA_SOURCES))
-
-ifeq ($(PLATFORM),windows)
- ALL_FLAGS = -gstabs+ $(TRACE) $(INCLUDES) -DBUILD_CAST_DLL
- DLLEXT = dll
-else
-ifeq ($(PLATFORM),Darwin)
- ALL_FLAGS = -gstabs+ $(TRACE) $(INCLUDES) -fPIC
- DLLEXT = jnilib
-else
- ALL_FLAGS = -pthread -gstabs+ $(TRACE) $(INCLUDES) -fPIC
- DLLEXT = so
-endif
-endif
-
-ifeq ($(PLATFORM),windows)
- CC_LDFLAGS = -shared -Wl,--add-stdcall-alias -Wl,-export-all-symbols
- LIBPREFIX =
-else
-ifeq ($(PLATFORM),Darwin)
- CC_LDFLAGS = -dynamiclib -Wl,-flat_namespace
- LIBPREFIX = lib
-else
- CC_LDFLAGS = -pthread -shared
- LIBPREFIX = lib
-endif
-endif
+include Makefile.definitions
#
# rules
#
-default: $(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT)
+default: $(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT) $(DOMO_AST_BIN)$(LIBPREFIX)cast.a
bindir:
mkdir -p $(C_GENERATED)
$(CAPA_JNI_BRIDGE_HEADER): $(DOMO_AST_BIN)com/ibm/wala/cast/ir/translator/NativeBridge.class bindir
- $(JAVA_SDK)bin/javah -classpath "$(DOMO_AST_BIN)$(JAVAH_CLASS_PATH)" -d "$(JAVAH_GENERATED)" com.ibm.wala.cast.ir.translator.NativeBridge
+ $(JAVA_HOME)/bin/javah -classpath "$(DOMO_AST_BIN)$(JAVAH_CLASS_PATH)" -d "$(JAVAH_GENERATED)" com.ibm.wala.cast.ir.translator.NativeBridge
$(CAPA_JNI_XLATOR_HEADER): $(DOMO_AST_BIN)com/ibm/wala/cast/ir/translator/NativeTranslatorToCAst.class bindir
- $(JAVA_SDK)bin/javah -classpath "$(DOMO_AST_BIN)$(JAVAH_CLASS_PATH)" -d "$(JAVAH_GENERATED)" com.ibm.wala.cast.ir.translator.NativeTranslatorToCAst
+ $(JAVA_HOME)/bin/javah -classpath "$(DOMO_AST_BIN)$(JAVAH_CLASS_PATH)" -d "$(JAVAH_GENERATED)" com.ibm.wala.cast.ir.translator.NativeTranslatorToCAst
$(CAPA_OBJECTS): $(C_GENERATED)%.o: %.cpp $(CAPA_JNI_HEADERS) bindir
- echo $(CAPA_OBJECTS)
$(CC) $(ALL_FLAGS) -o $@ -c $<
$(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT): $(CAPA_OBJECTS)
$(CC) $(CC_LDFLAGS) $^ -o $@
+$(DOMO_AST_BIN)$(LIBPREFIX)cast.a: $(CAPA_OBJECTS)
+ ar -r $@ $^
+
clean:
rm -rf $(C_GENERATED) hs_err_pid*
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/Makefile.configuration wala-1.5.1/com.ibm.wala.cast/source/c/Makefile.configuration
--- wala-1.3.9/com.ibm.wala.cast/source/c/Makefile.configuration 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/Makefile.configuration 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,12 @@
+# -*- makefile -*-
+
+# configuration of installed Java SDK
+JRE_DIR := $(shell java -XshowSettings:properties -version 2>&1 | sed -n 's/^ *java\.home = \(.*\)/\1/p')/
+JAVA_SDK := $(realpath $(JRE_DIR)..)/
+JNI_MD_DIR := $(notdir $(patsubst %/,%,$(dir $(wildcard $(JAVA_SDK)include/*/jni_md.h))))
+
+# configuration of WALA build tree
+CAST_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..)/
+DOMO_AST_BIN := $(CAST_DIR)target/classes/
+JAVAH_CLASS_PATH := :$(CAST_DIR)target/classes/
+TRACE :=
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/Makefile.configuration.sample wala-1.5.1/com.ibm.wala.cast/source/c/Makefile.configuration.sample
--- wala-1.3.9/com.ibm.wala.cast/source/c/Makefile.configuration.sample 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/Makefile.configuration.sample 1970-01-01 00:00:00.000000000 +0000
@@ -1,15 +0,0 @@
-#
-# global configuration. adjust for your system.
-#
-
-# The root of the java SDK to use (must end in /)
-JAVA_SDK = /System/Library/Frameworks/JavaVM.framework/Home/
-
-# Path .class files of the com.ibm.domo.ast Java code (must end in /)
-DOMO_AST_BIN = /com.ibm.wala.cast/bin/
-
-# Extra stuff needed in the classpath of javah (must start with path separator)
-JAVAH_CLASS_PATH = :/com.ibm.wala.cast/bin/
-
-# enable debugging flags
-TRACE =
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/c/Makefile.definitions wala-1.5.1/com.ibm.wala.cast/source/c/Makefile.definitions
--- wala-1.3.9/com.ibm.wala.cast/source/c/Makefile.definitions 1970-01-01 00:00:00.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/c/Makefile.definitions 2019-01-29 17:08:39.000000000 +0000
@@ -0,0 +1,64 @@
+#
+# in theory, these definitions should not need to be changed
+#
+
+ifeq (x$(PLATFORM),x)
+ PLATFORM=$(shell uname -s)
+endif
+
+C_GENERATED=$(DOMO_AST_BIN)libcast/
+
+JAVAH_GENERATED=$(C_GENERATED)
+ifeq ($(PLATFORM),windows)
+ CC=i686-mingw32-g++
+else
+ CC=g++
+endif
+
+vpath %.cpp jni
+
+JAVA_INCLUDES = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(JNI_MD_DIR) -DWALA_CLASSPATH="\"$(DOMO_AST_BIN)$(JAVAH_CLASS_PATH)\""
+
+CAPA_INCLUDE_DIR = ../../../com.ibm.wala.cast/source/c/include/
+CAPA_INCLUDES = -I$(CAPA_INCLUDE_DIR) -I$(C_GENERATED)
+
+CAPA_JNI_BRIDGE_HEADER = $(C_GENERATED)com_ibm_wala_cast_ir_translator_NativeBridge.h
+CAPA_JNI_XLATOR_HEADER = $(C_GENERATED)com_ibm_wala_cast_ir_translator_NativeTranslatorToCAst.h
+CAPA_JNI_HEADERS = $(CAPA_JNI_BRIDGE_HEADER) $(CAPA_JNI_XLATOR_HEADER)
+
+INCLUDES = $(CAPA_INCLUDES) $(JAVA_INCLUDES)
+
+CAPA_SOURCES = $(notdir $(wildcard jni/*.cpp))
+CAPA_OBJECTS = $(patsubst %.cpp,$(C_GENERATED)%.o,$(CAPA_SOURCES))
+
+ifeq ($(PLATFORM),windows)
+ ALL_FLAGS = -g $(TRACE) $(INCLUDES) -DBUILD_CAST_DLL
+ DLLEXT = dll
+else
+ifeq ($(PLATFORM),Darwin)
+ ALL_FLAGS = -g $(TRACE) $(INCLUDES) -fPIC
+ DLLEXT = jnilib
+else
+ ALL_FLAGS = -pthread -g $(TRACE) $(INCLUDES) -fPIC
+ DLLEXT = so
+endif
+endif
+
+ifeq ($(PLATFORM),windows)
+ CC_LDFLAGS = -shared -Wl,--add-stdcall-alias -Wl,-export-all-symbols
+ LIBPREFIX =
+else
+ifeq ($(PLATFORM),Darwin)
+ CC_LDFLAGS = -dynamiclib -Wl,-flat_namespace
+ LIBPREFIX = lib
+else
+ CC_LDFLAGS = -pthread -shared
+ LIBPREFIX = lib
+endif
+endif
+
+CC_LD_PATHS = -L$(JAVA_HOME)/jre/lib/amd64/server -Wl,-rpath -Wl,$(JAVA_HOME)/jre/lib/amd64/server -L$(JAVA_HOME)/jre/lib/x86_64/server -Wl,-rpath -Wl,$(JAVA_HOME)/jre/lib/x86_64/server -L$(JAVA_HOME)/jre/lib/x64/server -Wl,-rpath -Wl,$(JAVA_HOME)/jre/lib/x64/server -L$(JAVA_HOME)/jre/lib/server -Wl,-rpath -Wl,$(JAVA_HOME)/jre/lib/server -L$(JAVA_HOME)/jre/lib -Wl,-rpath -Wl,$(JAVA_HOME)/jre/lib -ljvm
+
+CC_LDFLAGS += $(CC_LD_PATHS)
+
+
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/java/com/ibm/wala/cast/analysis/typeInference/AstTypeInference.java wala-1.5.1/com.ibm.wala.cast/source/java/com/ibm/wala/cast/analysis/typeInference/AstTypeInference.java
--- wala-1.3.9/com.ibm.wala.cast/source/java/com/ibm/wala/cast/analysis/typeInference/AstTypeInference.java 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/java/com/ibm/wala/cast/analysis/typeInference/AstTypeInference.java 2019-01-29 17:08:39.000000000 +0000
@@ -21,9 +21,10 @@
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
import com.ibm.wala.cast.ir.ssa.AstLexicalWrite;
+import com.ibm.wala.cast.ir.ssa.AstPropertyRead;
+import com.ibm.wala.cast.ir.ssa.AstPropertyWrite;
import com.ibm.wala.cast.ir.ssa.EachElementGetInstruction;
import com.ibm.wala.cast.ir.ssa.EachElementHasNextInstruction;
-import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ssa.IR;
public abstract class AstTypeInference extends TypeInference {
@@ -32,6 +33,15 @@
protected class AstTypeOperatorFactory extends TypeOperatorFactory implements AstInstructionVisitor {
@Override
+ public void visitPropertyRead(AstPropertyRead inst) {
+ result = new DeclaredTypeOperator(new ConeType(cha.getRootClass()));
+ }
+
+ @Override
+ public void visitPropertyWrite(AstPropertyWrite inst) {
+ }
+
+ @Override
public void visitAstLexicalRead(AstLexicalRead inst) {
result = new DeclaredTypeOperator(new ConeType(cha.getRootClass()));
}
@@ -73,9 +83,9 @@
public void visitEcho(AstEchoInstruction inst) {
}
- };
+ }
- public AstTypeInference(IR ir, IClassHierarchy cha, TypeAbstraction booleanType, boolean doPrimitives) {
+ public AstTypeInference(IR ir, TypeAbstraction booleanType, boolean doPrimitives) {
super(ir, doPrimitives);
this.booleanType = booleanType;
}
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/ArgumentInstanceContext.java wala-1.5.1/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/ArgumentInstanceContext.java
--- wala-1.3.9/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/ArgumentInstanceContext.java 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/ArgumentInstanceContext.java 2019-01-29 17:08:39.000000000 +0000
@@ -75,8 +75,8 @@
@Override
public String toString() {
- return "ArgumentInstanceContext [base=" + base + ", index=" + index + ", instanceKey=" + instanceKey + "]";
+ return "ArgumentInstanceContext [base=" + base + ", index=" + index + ", instanceKey=" + instanceKey + ']';
}
-}
\ No newline at end of file
+}
diff -Nru wala-1.3.9/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java wala-1.5.1/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java
--- wala-1.3.9/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java 2016-05-10 12:59:26.000000000 +0000
+++ wala-1.5.1/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java 2019-01-29 17:08:39.000000000 +0000
@@ -11,8 +11,8 @@
package com.ibm.wala.cast.ipa.callgraph;
import java.util.ConcurrentModificationException;
-import java.util.Iterator;
import java.util.Set;
+import java.util.function.Function;
import com.ibm.wala.cast.ir.cfg.AstInducedCFG;
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
@@ -20,37 +20,35 @@
import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
-import com.ibm.wala.ipa.callgraph.AnalysisCache;
+import com.ibm.wala.classLoader.NewSiteReference;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.ipa.callgraph.Context;
+import com.ibm.wala.ipa.callgraph.IAnalysisCacheView;
import com.ibm.wala.ipa.callgraph.impl.AbstractRootMethod;
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
import com.ibm.wala.ipa.callgraph.impl.ExplicitCallGraph;
-import com.ibm.wala.ipa.callgraph.impl.FakeRootMethod;
import com.ibm.wala.ipa.cha.IClassHierarchy;
-import com.ibm.wala.ssa.DefUse;
-import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
import com.ibm.wala.ssa.SSAInstruction;
+import com.ibm.wala.ssa.SSANewInstruction;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.TypeReference;
-import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.collections.HashSetFactory;
-import com.ibm.wala.util.functions.Function;
+import com.ibm.wala.util.collections.Iterator2Iterable;
public class AstCallGraph extends ExplicitCallGraph {
- public AstCallGraph(IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache) {
- super(cha, options, cache);
+ public AstCallGraph(IMethod fakeRootClass2, AnalysisOptions options, IAnalysisCacheView cache) {
+ super(fakeRootClass2, options, cache);
}
public static class AstFakeRoot extends AbstractRootMethod {
- public AstFakeRoot(MethodReference rootMethod, IClass declaringClass, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache) {
+ public AstFakeRoot(MethodReference rootMethod, IClass declaringClass, IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) {
super(rootMethod, declaringClass, cha, options, cache);
}
- public AstFakeRoot(MethodReference rootMethod, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache) {
+ public AstFakeRoot(MethodReference rootMethod, IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) {
super(rootMethod, cha, options, cache);
}
@@ -68,25 +66,34 @@
public static abstract class ScriptFakeRoot extends AstFakeRoot {
- public ScriptFakeRoot(MethodReference rootMethod, IClass declaringClass, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache) {
+ public ScriptFakeRoot(MethodReference rootMethod, IClass declaringClass, IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) {
super(rootMethod, declaringClass, cha, options, cache);
}
- public ScriptFakeRoot(MethodReference rootMethod, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache) {
+ public ScriptFakeRoot(MethodReference rootMethod, IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) {
super(rootMethod, cha, options, cache);
}
public abstract SSAAbstractInvokeInstruction addDirectCall(int functionVn, int[] argVns, CallSiteReference callSite);
+ @Override
+ public SSANewInstruction addAllocation(TypeReference T) {
+ if (cha.isSubclassOf(cha.lookupClass(T), cha.lookupClass(declaringClass.getClassLoader().getLanguage().getRootType()))) {
+ int instance = nextLocal++;
+ NewSiteReference ref = NewSiteReference.make(statements.size(), T);
+ SSANewInstruction result = getDeclaringClass().getClassLoader().getInstructionFactory().NewInstruction(statements.size(), instance, ref);
+ statements.add(result);
+ return result;
+ } else {
+ return super.addAllocation(T);
+ }
+ }
+
}
public class AstCGNode extends ExplicitNode {
private Set> callbacks;
- private IR cachedIR;
-
- private DefUse cachedDU;
-
private AstCGNode(IMethod method, Context context) {
super(method, context);
}
@@ -96,8 +103,8 @@
boolean done = false;
while (!done) {
try {
- for (Iterator> x = callbacks.iterator(); x.hasNext();) {
- x.next().apply(null);
+ for (Function