flopppp
This commit is contained in:
parent
01bff40719
commit
eba135ad2c
22
Jocaml.java
22
Jocaml.java
|
@ -170,6 +170,14 @@ public class Jocaml {
|
|||
this.code = code;
|
||||
this.numArgs = numArgs;
|
||||
}
|
||||
|
||||
static {
|
||||
for (int i = 0; i < CamlInst.values().length; i++) {
|
||||
if (CamlInst.values()[i].code != i) {
|
||||
throw new RuntimeException("what");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class CodeOffset {
|
||||
|
@ -413,15 +421,13 @@ public class Jocaml {
|
|||
while (this.data.position() < this.data.capacity()) {
|
||||
int op = this.data.getInt();
|
||||
String rep = null;
|
||||
for (CamlInst inst : CamlInst.values()) {
|
||||
if (inst.code == op) {
|
||||
rep = inst.name();
|
||||
for (int i = 0; i < inst.numArgs; i++) {
|
||||
rep += " " + this.data.getInt();
|
||||
}
|
||||
try {
|
||||
CamlInst inst = CamlInst.values()[op];
|
||||
rep = inst.name();
|
||||
for (int i = 0; i < inst.numArgs; i++) {
|
||||
rep += " " + this.data.getInt();
|
||||
}
|
||||
}
|
||||
if (rep == null) {
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
rep = "<UNKNOWN " + op + ">";
|
||||
}
|
||||
System.out.println(rep);
|
||||
|
|
Loading…
Reference in New Issue