mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-10 22:37:38 +02:00
Pass actual arg to numerical op raise()
This commit is contained in:
parent
42b524f9cb
commit
abc37155a9
2 changed files with 9 additions and 5 deletions
2
TODO
2
TODO
|
@ -1,7 +1,5 @@
|
||||||
Working TODO list:
|
Working TODO list:
|
||||||
|
|
||||||
- Cyc_sum, etc: can we pass the actual arg(s) to the error function?
|
|
||||||
|
|
||||||
- make *trace-level* a command-line parameter, and by default do not emit scheme code transformations in comments
|
- make *trace-level* a command-line parameter, and by default do not emit scheme code transformations in comments
|
||||||
- Reduction in size of generated code
|
- Reduction in size of generated code
|
||||||
is there anything we can do?
|
is there anything we can do?
|
||||||
|
|
12
runtime.h
12
runtime.h
|
@ -797,7 +797,10 @@ static common_type FUNC_OP(object x, object y) { \
|
||||||
} else if (tx == double_tag && ty == double_tag) { \
|
} else if (tx == double_tag && ty == double_tag) { \
|
||||||
s.double_t.value = ((double_type *)x)->value OP ((double_type *)y)->value; \
|
s.double_t.value = ((double_type *)x)->value OP ((double_type *)y)->value; \
|
||||||
} else { \
|
} else { \
|
||||||
Cyc_rt_raise_msg("Bad argument type\n"); \
|
make_string(s, "Bad argument type"); \
|
||||||
|
make_cons(c1, y, nil); \
|
||||||
|
make_cons(c0, &s, &c1); \
|
||||||
|
Cyc_rt_raise(&c0); \
|
||||||
} \
|
} \
|
||||||
return s; \
|
return s; \
|
||||||
} \
|
} \
|
||||||
|
@ -839,7 +842,10 @@ static common_type Cyc_num_op_va_list(int argc, common_type (fn_op(object, objec
|
||||||
sum.double_t.tag = double_tag;
|
sum.double_t.tag = double_tag;
|
||||||
sum.double_t.value = ((double_type *)n)->value;
|
sum.double_t.value = ((double_type *)n)->value;
|
||||||
} else {
|
} else {
|
||||||
Cyc_rt_raise_msg("Bad argument type");
|
make_string(s, "Bad argument type");
|
||||||
|
make_cons(c1, n, nil);
|
||||||
|
make_cons(c0, &s, &c1);
|
||||||
|
Cyc_rt_raise(&c0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
|
@ -851,7 +857,7 @@ static common_type Cyc_num_op_va_list(int argc, common_type (fn_op(object, objec
|
||||||
sum.double_t.tag = double_tag;
|
sum.double_t.tag = double_tag;
|
||||||
sum.double_t.value = ((double_type *) &result)->value;
|
sum.double_t.value = ((double_type *) &result)->value;
|
||||||
} else {
|
} else {
|
||||||
Cyc_rt_raise_msg("Invalid tag in Cyc_num_op_va_list");
|
Cyc_rt_raise_msg("Internal error, invalid tag in Cyc_num_op_va_list");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue