X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=expr.c;h=d1b9ac2e08e50114af26a0272cc93f5e0123348b;hb=a47cfb0704fdda11fe194a2eab611f3f82e95a03;hp=07391acfe6f8fceb5dfaabcdaea036f1acf9b117;hpb=d9aaeb6dc9db7a224a85e8a8ca44ddcb23cf7657;p=rmac diff --git a/expr.c b/expr.c index 07391ac..d1b9ac2 100644 --- a/expr.c +++ b/expr.c @@ -194,7 +194,7 @@ getsym: if (*tok != SYMBOL && *tok != STRING) return error(str_error); - p = string[tok[1]]; + p2 = string[tok[1]]; tok += 2; w = (WORD)(!strcmp(p, p2)); @@ -311,8 +311,9 @@ int expr(TOKEN * otk, VALUE * a_value, WORD * a_attr, SYM ** a_esym) // followed by the value 101, it will trigger a bad evaluation here. // This is probably a really bad assumption to be making here...! // (assuming tok[1] == EOL is a single token that is) + // Seems that even other tokens (SUNARY type) can fuck this up too. // if ((tok[1] == EOL) - if ((tok[1] == EOL && tok[0] != CONST) + if ((tok[1] == EOL && (tok[0] != CONST && tokenClass[tok[0]] != SUNARY)) || (((*tok == CONST || *tok == SYMBOL) || (*tok >= KW_R0 && *tok <= KW_R31)) && (tokenClass[tok[2]] < UNARY))) {