aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-23 09:04:27 +0100
committerlemon <lsof@mailbox.org>2025-11-23 09:04:27 +0100
commit6d8e1c6b8bff19b68c7386325faeb2a425e3173a (patch)
tree71026c7bb138b88ef902a46a46549db4ac6b6d7a
parentf381c0854a02aad57f887f335fb84c0e5de32ec5 (diff)
cpp: fix ## bug
-rw-r--r--c/lex.c2
-rw-r--r--todo.txt1
2 files changed, 1 insertions, 2 deletions
diff --git a/c/lex.c b/c/lex.c
index 548f82c..e2e42d4 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -1100,7 +1100,7 @@ expandfnmacro(struct lexer *lx, struct span *span, struct macro *mac)
tk = mac->rlist.tk[i];
if (tk.t == TKPPCAT) {
if (i > 0 && i < mac->rlist.n-1) {
- const struct token *lhs = rlist2.n ? &rlist2.p[rlist2.n-1] : &mac->rlist.tk[i-1],
+ const struct token *lhs = &mac->rlist.tk[i-1],
*rhs = &mac->rlist.tk[i+1];
struct token new;
if (lhs->t != TKPPMACARG && rhs->t != TKPPMACARG) {
diff --git a/todo.txt b/todo.txt
index 773a37b..c022967 100644
--- a/todo.txt
+++ b/todo.txt
@@ -3,7 +3,6 @@ Things to finish before moving onto compiler optimizations, C extensions, other
- self host. not yet compiling:
- io.c (TODO varargs)
- c/eval.c, ir/fold.c (NYI flt -> u64 cvt)
- - c/builtin.c (preprocessor bugs)
- ir/optmem.c (preprocessor bugs w/ imap macros)
- embedfilesdir.c (static eval bug)