shithub: sl

Download patch

ref: 053f9ab110a55a24150c8cae285176fda8831fad
parent: 2c2af0954a19603616430cd24835a2b22a84d75c
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Nov 21 18:35:38 EST 2024

isbuiltin: check the tag first, then uintval

--- a/flisp.c
+++ b/flisp.c
@@ -29,8 +29,8 @@
 int
 isbuiltin(value_t x)
 {
-	uint32_t i = uintval(x);
-	return tag(x) == TAG_FUNCTION && i < nelem(builtins) && builtins[i].name != nil;
+	uint32_t i;
+	return tag(x) == TAG_FUNCTION && (i = uintval(x)) < nelem(builtins) && builtins[i].name != nil;
 }
 
 static value_t apply_cl(uint32_t nargs);