mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add MRB_WORD_BOXING mode (represent mrb_value as a word)
This commit is contained in:
+4
-4
@@ -1901,7 +1901,7 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
i = readint_mrb_int(s, p, base, FALSE, &overflow);
|
||||
if (overflow) {
|
||||
double f = readint_float(s, p, base);
|
||||
int off = new_lit(s, mrb_float_value(f));
|
||||
int off = new_lit(s, mrb_float_value(s->mrb, f));
|
||||
|
||||
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));
|
||||
}
|
||||
@@ -1923,7 +1923,7 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
if (val) {
|
||||
char *p = (char*)tree;
|
||||
mrb_float f = str_to_mrb_float(p);
|
||||
int off = new_lit(s, mrb_float_value(f));
|
||||
int off = new_lit(s, mrb_float_value(s->mrb, f));
|
||||
|
||||
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));
|
||||
push();
|
||||
@@ -1939,7 +1939,7 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
{
|
||||
char *p = (char*)tree;
|
||||
mrb_float f = str_to_mrb_float(p);
|
||||
int off = new_lit(s, mrb_float_value(-f));
|
||||
int off = new_lit(s, mrb_float_value(s->mrb, -f));
|
||||
|
||||
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));
|
||||
push();
|
||||
@@ -1957,7 +1957,7 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
i = readint_mrb_int(s, p, base, TRUE, &overflow);
|
||||
if (overflow) {
|
||||
double f = readint_float(s, p, base);
|
||||
int off = new_lit(s, mrb_float_value(-f));
|
||||
int off = new_lit(s, mrb_float_value(s->mrb, -f));
|
||||
|
||||
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user