• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Baremetal Lisp interpreter and compiler for low-resource devices


Commit MetaInfo

Revisiona9830c2c3569c04d89441b638de1ac7958ba8b38 (tree)
Zeit2020-09-13 06:42:08
AutorAlaskanEmily <emily@alas...>
CommiterAlaskanEmily

Log Message

Fix type-hint validation for record hints in defun

Ändern Zusammenfassung

Diff

--- a/sl_i.c
+++ b/sl_i.c
@@ -160,8 +160,13 @@ static void sl_i_defun(struct SL_I_Runtime *rt,
160160 #endif
161161 /* Not a builtin, check for a defrec. */
162162 for(i = 0; i < rt->num_recs; i++){
163- if(SL_S_COMPARE_ATOMS(rt->recs[i].name, atom))
163+ if(atom->len - 1 == rt->recs[i].name->len &&
164+ SL_S_MemComp(atom->text + 1,
165+ rt->recs[i].name->text,
166+ atom->len - 1) == 0){
167+
164168 goto type_hint_ok;
169+ }
165170 }
166171
167172 /* Not OK! We don't know what this hint means. */
Binary files a/sli and /dev/null differ
--- /dev/null
+++ b/tests/hint_rec.lsp
@@ -0,0 +1,9 @@
1+; Any copyright is dedicated to the Public Domain.
2+; https://creativecommons.org/publicdomain/zero/1.0/
3+
4+(defrec foo
5+ ^int i
6+ x)
7+
8+(defun bar (^foo x) nil
9+