# HG changeset patch # User lost@l-w.ca # Date 1303355574 21600 # Node ID da74ccf4278cdde5bf84acd5360ba632f47a48ef # Parent 3d50022e16e7cf6408afff1feca63ade8db39ce7 Fixed bug parsing octal constants under cescapes pragma diff -r 3d50022e16e7 -r da74ccf4278c lwasm/pseudo.c --- a/lwasm/pseudo.c Wed Apr 13 19:01:53 2011 -0600 +++ b/lwasm/pseudo.c Wed Apr 20 21:12:54 2011 -0600 @@ -217,7 +217,7 @@ (*p)++; if (!**p) break; - + switch (**p) { /* octal sequence or NUL */ @@ -226,16 +226,17 @@ case '1': case '2': case '3': - (*p)++; + wch = **p; wch -= 0x30; - if (**p >= '0' && **p <= '9') + if ((*p)[1] >= '0' && (*p)[1] < '8') { + (*p)++; wch *= 8; wch += **p - 0x30; + } + if ((*p)[1] >= '0' && (*p)[1] < '8') + { (*p)++; - } - if (**p >= '0' && **p <= '9') - { wch *= 8; wch += **p -0x30; }