gpgscm: Improve syntax checking.

* tests/gpgscm/scheme.c (opexe_0): Make sure closure arguments are
symbols.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-04-20 15:09:13 +02:00
parent ee715201ae
commit 4aab0e6ac7
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
1 changed files with 5 additions and 2 deletions

View File

@ -3559,10 +3559,13 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
is_pair(x); x = cdr(x), y = cdr(y)) {
if (y == sc->NIL) {
Error_1(sc, "not enough arguments, missing:", x);
} else {
} else if (is_symbol(car(x))) {
new_slot_in_env(sc, car(x), car(y));
}
} else {
Error_1(sc, "syntax error in closure: not a symbol", car(x));
}
}
if (x == sc->NIL) {
if (y != sc->NIL) {
Error_0(sc, "too many arguments");