define convert method mrb_int/mrb_float with C string

This commit is contained in:
Yuichiro MASUI
2012-10-27 14:26:50 +09:00
parent 559933f577
commit 15f46a1feb
5 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -1738,7 +1738,7 @@ codegen(codegen_scope *s, node *tree, int val)
case NODE_FLOAT:
if (val) {
char *p = (char*)tree;
mrb_float f = readfloat(p);
mrb_float f = str_to_mrb_float(p);
int off = new_lit(s, mrb_float_value(f));
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));
@@ -1754,7 +1754,7 @@ codegen(codegen_scope *s, node *tree, int val)
case NODE_FLOAT:
{
char *p = (char*)tree;
mrb_float f = readfloat(p);
mrb_float f = str_to_mrb_float(p);
int off = new_lit(s, mrb_float_value(-f));
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));