diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-02-27 00:51:09 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-02-27 00:51:09 +0100 |
commit | d316047326fde9d63ca52c0051fbf09124ef297e (patch) | |
tree | 6b95116db5c1316c785e095b6898d71e9d38dab5 /test-suite/tests/tree-il.test | |
parent | a850c3ccc4bebe07dba2298c5ed0bc86bb64f172 (diff) | |
download | guile-d316047326fde9d63ca52c0051fbf09124ef297e.tar.gz |
Avoid failure when `format-analysis' stumbles upon unbound variables.
* module/language/tree-il/analyze.scm (proc-ref?): Wrap `variable-ref'
in `false-if-exception'.
* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
format string with forward declaration"): New test.
Diffstat (limited to 'test-suite/tests/tree-il.test')
-rw-r--r-- | test-suite/tests/tree-il.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test index 945b23614..c4966b3e1 100644 --- a/test-suite/tests/tree-il.test +++ b/test-suite/tests/tree-il.test @@ -2184,6 +2184,19 @@ #:opts %opts-w-format #:to 'assembly))))) + (pass-if "non-literal format string with forward declaration" + (let ((w (call-with-warnings + (lambda () + (compile '(begin + (define (foo) + (format #t (_ "~A ~A!") "hello" "world")) + (define _ bar)) + #:opts %opts-w-format + #:to 'assembly))))) + (and (= (length w) 1) + (number? (string-contains (car w) + "non-literal format string"))))) + (pass-if "wrong format string" (let ((w (call-with-warnings (lambda () |