Fix NPE that is sometimes thrown when generating debug information.

Enable debug information for html4j TCK
This commit is contained in:
konsoletyper 2014-09-11 10:49:22 +04:00
parent 64847c3888
commit b0b9287659
4 changed files with 7 additions and 4 deletions

View File

@ -72,7 +72,6 @@
<phase>process-test-classes</phase>
<configuration>
<minifying>false</minifying>
<incremental>true</incremental>
<numThreads>1</numThreads>
<properties>
<java.util.Locale.available>en, en_US, en_GB, ru, ru_RU</java.util.Locale.available>

View File

@ -79,7 +79,9 @@ class LocationGraphBuilder {
}
}
if (graph.outgoingEdgesCount(step.block) == 0) {
addEdge(location, new InstructionLocation(null, -1));
if (location != null) {
addEdge(location, new InstructionLocation(null, -1));
}
} else {
for (int next : graph.outgoingEdges(step.block)) {
stack.push(new Step(location, started ? new HashSet<InstructionLocation>() : step.startLocations,

View File

@ -368,7 +368,6 @@ public class TeaVMTestTool {
try (OutputStream debugInfoOut = new FileOutputStream(new File(outputDir, targetName + ".teavmdbg"))) {
debugInfo.write(debugInfoOut);
}
log.info("Debug information successfully written");
}
if (sourceMapsGenerated) {
DebugInformation debugInfo = debugInfoBuilder.getDebugInformation();
@ -377,7 +376,6 @@ public class TeaVMTestTool {
new File(outputDir, sourceMapsFileName)), "UTF-8")) {
debugInfo.writeAsSourceMaps(sourceMapsOut, targetName);
}
log.info("Source maps successfully written");
}
}

View File

@ -81,6 +81,8 @@
<minifying>false</minifying>
<numThreads>1</numThreads>
<outputDir>${project.build.directory}/javascript-test</outputDir>
<debugInformationGenerated>true</debugInformationGenerated>
<sourceMapsGenerated>true</sourceMapsGenerated>
</configuration>
</execution>
<execution>
@ -98,6 +100,8 @@
<transformers>
<param>org.teavm.javascript.NullPointerExceptionTransformer</param>
</transformers>
<debugInformationGenerated>true</debugInformationGenerated>
<sourceMapsGenerated>true</sourceMapsGenerated>
</configuration>
</execution>
</executions>