mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
Checking for negative values in make-vector.
This commit is contained in:
parent
1021344aef
commit
a13e30ce7d
1 changed files with 2 additions and 0 deletions
2
vm.c
2
vm.c
|
@ -1456,6 +1456,8 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
|
|||
sexp_context_top(ctx) = top;
|
||||
if (! sexp_fixnump(_ARG1))
|
||||
sexp_raise("make-vector: not an integer", sexp_list1(ctx, _ARG1));
|
||||
if (sexp_unbox_fixnum(_ARG1) < 0)
|
||||
sexp_raise("make-vector: length must be non-negative", sexp_list1(ctx, _ARG1));
|
||||
_ARG2 = sexp_make_vector(ctx, _ARG1, _ARG2);
|
||||
top--;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue