refine expt constant-fold-fail message
svn: r14186
This commit is contained in:
parent
88222f7df4
commit
8e175869d9
|
@ -890,14 +890,15 @@ Scheme_Object *scheme_generic_integer_power(const Scheme_Object *a, const Scheme
|
|||
|
||||
if (scheme_current_thread->constant_folding) {
|
||||
/* if we're trying to fold a constant, limit the work that we're willing to do at compile time */
|
||||
GC_CAN_IGNORE const char *too_big = "arguments too big to fold `expt'";
|
||||
if (SCHEME_BIGNUMP(b)
|
||||
|| (SCHEME_INT_VAL(b) > 10000))
|
||||
scheme_signal_error("too big");
|
||||
scheme_signal_error(too_big);
|
||||
else if (SCHEME_BIGNUMP(a)) {
|
||||
int len = SCHEME_BIGLEN(a);
|
||||
if ((len > 10000)
|
||||
|| (len * SCHEME_INT_VAL(b)) > 10000)
|
||||
scheme_signal_error("too big");
|
||||
scheme_signal_error(too_big);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user