summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/source/procyon
diff options
context:
space:
mode:
authorGravatar Runemoro2020-03-19 18:30:59 -0400
committerGravatar Runemoro2020-03-19 18:30:59 -0400
commit942d99fda384d248e6a77a8c3101afe772320560 (patch)
treef3fcc76961b1b5e1aa981c213eba0e470d9d34f0 /src/main/java/cuchaz/enigma/source/procyon
parentAdd support for reading/writing zipped mappings (#199) (diff)
downloadenigma-fork-942d99fda384d248e6a77a8c3101afe772320560.tar.gz
enigma-fork-942d99fda384d248e6a77a8c3101afe772320560.tar.xz
enigma-fork-942d99fda384d248e6a77a8c3101afe772320560.zip
Fix CFR-related bugs
Diffstat (limited to 'src/main/java/cuchaz/enigma/source/procyon')
-rw-r--r--src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java b/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java
index db90ffa..62e7c10 100644
--- a/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java
+++ b/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java
@@ -17,6 +17,11 @@ public class TokenFactory {
17 String name = node instanceof Identifier ? ((Identifier) node).getName() : ""; 17 String name = node instanceof Identifier ? ((Identifier) node).getName() : "";
18 Region region = node.getRegion(); 18 Region region = node.getRegion();
19 19
20 if (region.getBeginLine() == 0) {
21 System.err.println("Got bad region from Procyon for node " + node);
22 return null;
23 }
24
20 int start = index.getPosition(region.getBeginLine(), region.getBeginColumn()); 25 int start = index.getPosition(region.getBeginLine(), region.getBeginColumn());
21 int end = index.getPosition(region.getEndLine(), region.getEndColumn()); 26 int end = index.getPosition(region.getEndLine(), region.getEndColumn());
22 String text = index.getSource().substring(start, end); 27 String text = index.getSource().substring(start, end);