# HG changeset patch # User lost@l-w.ca # Date 1281334224 21600 # Node ID cac20467643441e982587a86f1a8bd941d089991 # Parent acaafc70044b2730a319cef458c9fd363453a2bc Allow symbols to start with digits if they contain $, ?, or @; numbered locals diff -r acaafc70044b -r cac204676434 lwasm/pass1.c --- a/lwasm/pass1.c Sun Aug 08 23:47:16 2010 -0600 +++ b/lwasm/pass1.c Mon Aug 09 00:10:24 2010 -0600 @@ -151,6 +151,8 @@ p1++; if (!*p1 && !isspace(*p1)) p1 = line; + else if (*p1 && !isspace(*p1)) + p1 = line; else if (*p1 && isspace(*p1)) p1++; } diff -r acaafc70044b -r cac204676434 lwasm/symbol.c --- 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;