diff lwasm/symbol.c @ 411:cac204676434

Allow symbols to start with digits if they contain $, ?, or @; numbered locals
author lost@l-w.ca
date Mon, 09 Aug 2010 00:10:24 -0600
parents 502fbc37ff4e
children
line wrap: on
line diff
--- a/lwasm/symbol.c	Sun Aug 08 23:47:16 2010 -0600
+++ b/lwasm/symbol.c	Mon Aug 09 00:10:24 2010 -0600
@@ -88,7 +88,12 @@
 
 	if (!(flags & symbol_flag_nocheck))
 	{
-		if (*sym < 0x80 && !strchr(SSYMCHARS, *sym))
+		if (!sym || !*sym)
+		{
+			lwasm_register_error(as, cl, "Bad symbol (%s)", sym);
+			return NULL;
+		}
+		if (*sym < 0x80 && (!strchr(SSYMCHARS, *sym) && !strchr(sym + 1, '$') && !strchr(sym + 1, '@') && !strchr(sym + 1, '?')))
 		{
 			lwasm_register_error(as, cl, "Bad symbol (%s)", sym);
 			return NULL;