mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
define convert method mrb_int/mrb_float with C string
This commit is contained in:
+2
-2
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user