Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle Inf/-Inf/NaN in bytecode assembler.
  • Loading branch information
jnthn committed Jun 21, 2013
1 parent f9e0a2b commit eab1b7c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/vm/jvm/runtime/org/perl6/nqp/jast2bc/JASTToJVMBytecode.java
Expand Up @@ -350,8 +350,15 @@ else if (curLine.startsWith("++ handlers ")) {
m.visitLdcInsn(value);
}
else if (curLine.startsWith(".push_nc ")) {
Double value = Double.parseDouble(curLine.substring(".push_nc ".length()));
m.visitLdcInsn(value);
String dStr = curLine.substring(".push_nc ".length());
if (dStr.equals("Inf"))
m.visitLdcInsn(Double.POSITIVE_INFINITY);
else if (dStr.equals("-Inf"))
m.visitLdcInsn(Double.NEGATIVE_INFINITY);
else if (dStr.equals("NaN"))
m.visitLdcInsn(Double.NaN);
else
m.visitLdcInsn(Double.parseDouble(dStr));
}
else if (curLine.startsWith(".push_sc ")) {
String value = curLine.substring(".push_sc ".length());
Expand Down

0 comments on commit eab1b7c

Please sign in to comment.