shithub: scc

Download patch

ref: 4603a2a279d2bfd1323488d4cb467d6287fed735
parent: c231c04f8d22b3b6a46fa49c7da5f7a829380a02
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat May 9 13:56:07 EDT 2015

Fix iden()

A valid identifier has _ digits and letters.

--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -367,10 +367,10 @@
 static uint8_t
 iden(void)
 {
-	char c, *p;
+	char *p;
 	Symbol *sym;
 
-	for (p = input->p; isalpha(*p); ++p)
+	for (p = input->p; isalnum(*p) || *p == '_'; ++p)
 		/* nothing */;
 	input->p = p;
 	tok2str();