>From 8e712bed749401c6de27d6985591d1c4378ae593 Mon Sep 17 00:00:00 2001 From: Christian Kellermann
Date: Sat, 17 Mar 2012 19:36:46 +0100 Subject: [PATCH] Do not specialise make-vector calls with negative lengths --- c-platform.scm | 2 +- tests/library-tests.scm | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/c-platform.scm b/c-platform.scm index 856af14..d502dc0 100644 --- a/c-platform.scm +++ b/c-platform.scm @@ -1045,7 +1045,7 @@ (let ([tmp (gensym)] [c (first (node-parameters n))] ) (and (fixnum? c) - (<= c 32) + (<= 0 c 32) (let ([val (if (pair? (cdr callargs)) (second callargs) (make-node '##core#undefined '() '()) ) ] ) diff --git a/tests/library-tests.scm b/tests/library-tests.scm index 79a7369..319c37a 100644 --- a/tests/library-tests.scm +++ b/tests/library-tests.scm @@ -268,3 +268,19 @@ (assert (= 2 guard-called)) +;;; vector and blob limits + +(define (error-occured? thunk) + (equal? + 'error-occured + (call-with-current-continuation + (lambda (exit) + (with-exception-handler + (lambda (e) (exit 'error-occured)) + thunk))))) + +(assert (error-occured? + (lambda () (make-vector -1)))) + +(assert (error-occured? + (lambda () (make-blob -1)))) -- 1.7.6