mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix bug in source map generation
This bug caused metadata lines that follow after the code generated from Java bytecode, to be mapped to the line in Java bytecode of the method that appears last in the generated JavaScript
This commit is contained in:
parent
e5c85dd3bd
commit
f2dd398719
|
@ -24,6 +24,7 @@ public class SourceLocationIterator {
|
|||
private GeneratedLocation location;
|
||||
private int fileId = -1;
|
||||
private int line = -1;
|
||||
private boolean endReached;
|
||||
|
||||
SourceLocationIterator(DebugInformation debugInformation) {
|
||||
this.debugInformation = debugInformation;
|
||||
|
@ -33,7 +34,7 @@ public class SourceLocationIterator {
|
|||
}
|
||||
|
||||
public boolean isEndReached() {
|
||||
return fileIndex >= debugInformation.fileMapping.size() && lineIndex >= debugInformation.lineMapping.size();
|
||||
return endReached;
|
||||
}
|
||||
|
||||
private void read() {
|
||||
|
@ -55,8 +56,10 @@ public class SourceLocationIterator {
|
|||
nextFileRecord();
|
||||
} else if (lineIndex < debugInformation.lineMapping.size()) {
|
||||
nextLineRecord();
|
||||
} else {
|
||||
} else if (endReached) {
|
||||
throw new IllegalStateException("End already reached");
|
||||
} else {
|
||||
endReached = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user