trifork / erjang

A JVM-based Erlang VM
http://www.erjang.org
Apache License 2.0
726 stars 62 forks source link

CompilerVisitor.constants map cannot contain both 0 and 0.0. #16

Closed eriksoe closed 14 years ago

eriksoe commented 14 years ago

CompilerVisitor.push_immediate() generates bad code for io_lib_format:fwrite_g/1; the code contains a reference to field "num_0" of type EDouble. The field exists, but has type ESmall. This bug is caused by collision between ESmall(0) and EDouble(0.0) in the constants map maintained by push_immediate().

krestenkrab commented 14 years ago

I fixed =:= to not compare 0 and 0.0 equals; and also added an equals method to EDouble. That seemed to do the trick for now.