Skip to content

Commit

Permalink
might fix #602
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 19, 2012
1 parent baac6f2 commit 88edd73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,9 @@ BOX_FUNC(float64, double, jl_box, 3)
static jl_value_t *boxed_##typ##_cache[NBOX_C]; \
jl_value_t *jl_box_##typ(c_type x) \
{ \
if ((u##c_type)(x+NBOX_C/2) < NBOX_C) \
return boxed_##typ##_cache[(x+NBOX_C/2)]; \
c_type idx = x+NBOX_C/2; \
if ((u##c_type)idx < (u##c_type)NBOX_C) \
return boxed_##typ##_cache[idx]; \
jl_value_t *v = alloc_##nw##w(); \
v->type = (jl_type_t*)jl_##typ##_type; \
*(c_type*)jl_bits_data(v) = x; \
Expand Down
3 changes: 3 additions & 0 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ static int is_intrinsic(jl_sym_t *s)

static int has_intrinsics(jl_expr_t *e)
{
if (e->args->length == 0)
return 0;
jl_value_t *e0 = jl_exprarg(e,0);
if (e->head == call_sym &&
((jl_is_symbol(e0) && is_intrinsic((jl_sym_t*)e0)) ||
Expand All @@ -298,6 +300,7 @@ static int has_intrinsics(jl_expr_t *e)
// the compiler or the interpreter.
static int eval_with_compiler_p(jl_expr_t *expr, int compileloops)
{
assert(jl_is_expr(expr));
if (expr->head==body_sym) {
jl_array_t *body = expr->args;
size_t i;
Expand Down

0 comments on commit 88edd73

Please sign in to comment.