aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-04-20 13:09:13 +0000
committerJustus Winter <[email protected]>2017-04-24 13:47:27 +0000
commit008894eff46724d60a24879d319b427606fcafd1 (patch)
tree77d6f468d2d6bc07034d810012cbe214fd9f70c4
parentgpgscm: Emit JUnit-style XML reports. (diff)
downloadlibgpg-error-008894eff46724d60a24879d319b427606fcafd1.tar.gz
libgpg-error-008894eff46724d60a24879d319b427606fcafd1.zip
gpgscm: Improve syntax checking.
* tests/gpgscm/scheme.c (opexe_0): Make sure closure arguments are symbols. Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--scheme.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/scheme.c b/scheme.c
index 11f6fcb..38f2870 100644
--- a/scheme.c
+++ b/scheme.c
@@ -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");