From b04157aa61bdd58e67ecb58d9c2375fe9900f11b Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 7 Oct 2007 18:12:11 +0000 Subject: [PATCH] fix bad input to raise an error as usual, added tests svn: r7445 original commit: 6c13e101bfc3f4f18c08f6bcdd8c0a23556c2a70 --- collects/mzlib/sandbox.ss | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/collects/mzlib/sandbox.ss b/collects/mzlib/sandbox.ss index d040cf8..6aa661f 100644 --- a/collects/mzlib/sandbox.ss +++ b/collects/mzlib/sandbox.ss @@ -431,16 +431,16 @@ (let loop ([n 1]) (let ([expr (channel-get input-ch)]) (when (eof-object? expr) (channel-put result-ch expr) (user-kill)) - (let ([code (input->code (list expr) 'eval n)]) - (with-handlers ([void (lambda (exn) - (channel-put result-ch (cons 'exn exn)))]) - (let* ([sec (and limits (car limits))] - [mb (and limits (cadr limits))] - [run (if (or sec mb) - (lambda () (with-limits sec mb (eval* code))) - (lambda () (eval* code)))]) - (channel-put result-ch - (cons 'vals (call-with-values run list)))))) + (with-handlers ([void (lambda (exn) + (channel-put result-ch (cons 'exn exn)))]) + (let* ([code (input->code (list expr) 'eval n)] + [sec (and limits (car limits))] + [mb (and limits (cadr limits))] + [run (if (or sec mb) + (lambda () (with-limits sec mb (eval* code))) + (lambda () (eval* code)))]) + (channel-put result-ch + (cons 'vals (call-with-values run list))))) (loop (add1 n))))) (define (user-eval expr) (let ([r (if user-thread