Hello hackers,
this patch does what it says on the tin and can be safely applied to
the 4 branch,
I didn't supply a separate patch in the hope the patch(1) deity
manages me to spare
this effort :)

Cheers,
Lemonboy
From 2647c9c815b45ed8fa91c675842b9c953612430b Mon Sep 17 00:00:00 2001
From: LemonBoy <[email protected]>
Date: Sat, 27 May 2017 22:58:31 +0200
Subject: [PATCH] Check the syntax correctness for some constructs

Forgetting to do so leads to segfaults in the compiler and suboptimal
error messages for the end user.
---
 chicken-ffi-syntax.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/chicken-ffi-syntax.scm b/chicken-ffi-syntax.scm
index a14369b4..d97a4174 100644
--- a/chicken-ffi-syntax.scm
+++ b/chicken-ffi-syntax.scm
@@ -203,6 +203,7 @@
  '()
  (##sys#er-transformer
   (lambda (form r c)
+    (##sys#check-syntax 'define-foreign-type form '(_ symbol symbol . #(symbol 0 2)))
     `(##core#define-foreign-type ,@(cdr form)))))
 
 (##sys#extend-macro-environment
@@ -210,6 +211,7 @@
  '()
  (##sys#er-transformer
   (lambda (form r c)
+    (##sys#check-syntax 'define-foreign-variable form '(_ symbol symbol . #(string 0 1)))
     `(##core#define-foreign-variable ,@(cdr form)))))
 
 (##sys#extend-macro-environment
-- 
2.13.0

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to