~tim/lydia

7306435d8ce7a363a8444c2117472bb3550178ea — Tim Morgan 8 years ago 831c58d
Fix bug in -> func causing seg fault on bad index.
1 files changed, 3 insertions(+), 1 deletions(-)

M src/lib/list.c
M src/lib/list.c => src/lib/list.c +3 -1
@@ 13,7 13,9 @@ LValue *l_func_list_get(LValue *args, LClosure *closure) {
  LValue *index = l_list_get(args, 1);
  l_assert_is(list, L_LIST_TYPE, L_ERR_MISSING_LIST, closure);
  l_assert_is(index, L_NUM_TYPE, L_ERR_MISSING_INDEX, closure);
  return l_list_get(list, mpz_get_si(index->core.num));
  LValue *value = l_list_get(list, mpz_get_si(index->core.num));
  if(value == NULL) value = l_value_new(L_NIL_TYPE, closure);
  return value;
}

LValue *l_func_count(LValue *args, LClosure *closure) {