mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
WIP
This commit is contained in:
parent
5c77948a00
commit
d1a6db14a7
1 changed files with 9 additions and 2 deletions
11
runtime.c
11
runtime.c
|
@ -2930,7 +2930,9 @@ object Cyc_num_op_va_list(void *data, int argc,
|
||||||
buf->bignum_t.hdr.mark = gc_color_red;
|
buf->bignum_t.hdr.mark = gc_color_red;
|
||||||
buf->bignum_t.hdr.grayed = 0;
|
buf->bignum_t.hdr.grayed = 0;
|
||||||
buf->bignum_t.tag = bignum_tag;
|
buf->bignum_t.tag = bignum_tag;
|
||||||
buf->bignum_t.bn = ((bignum_type *) n)->bn;
|
// TODO: allocate a new one here?
|
||||||
|
//buf->bignum_t.bn = ((bignum_type *) n)->bn;
|
||||||
|
mp_init_copy(&bignum_value(n), &(buf->bignum_t.bn));
|
||||||
} else {
|
} else {
|
||||||
goto bad_arg_type_error;
|
goto bad_arg_type_error;
|
||||||
}
|
}
|
||||||
|
@ -2946,9 +2948,14 @@ object Cyc_num_op_va_list(void *data, int argc,
|
||||||
if (type_of(&tmp) == integer_tag) {
|
if (type_of(&tmp) == integer_tag) {
|
||||||
buf->integer_t.tag = integer_tag;
|
buf->integer_t.tag = integer_tag;
|
||||||
buf->integer_t.value = integer_value(&tmp);
|
buf->integer_t.value = integer_value(&tmp);
|
||||||
} else {
|
} else if (type_of(&tmp) == double_tag){
|
||||||
buf->double_t.tag = double_tag;
|
buf->double_t.tag = double_tag;
|
||||||
buf->double_t.value = double_value(&tmp);
|
buf->double_t.value = double_value(&tmp);
|
||||||
|
} else {
|
||||||
|
buf->bignum_t.tag = bignum_tag;
|
||||||
|
//buf->bignum_t.bn = bignum_value(&tmp);
|
||||||
|
// TODO: free previous mp_init above?? or free tmp bn?
|
||||||
|
mp_init_copy(&(buf->bignum_t.bn), &(bignum_value(&tmp)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue