Commit 11f5fc04 by John Kessenich

glslang preprocassor: Fix operator precedence bug.

parent b7cc3311
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <cassert> #include <assert.h>
namespace spv { namespace spv {
......
...@@ -221,7 +221,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) ...@@ -221,7 +221,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
case CPP_UINTCONSTANT: case CPP_UINTCONSTANT:
strcpy(ppToken->name, tokenText); strcpy(ppToken->name, tokenText);
if (len > 0 && tokenText[0] == '0') { if (len > 0 && tokenText[0] == '0') {
if (len > 1 && tokenText[1] == 'x' || tokenText[1] == 'X') if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
ppToken->ival = strtol(ppToken->name, 0, 16); ppToken->ival = strtol(ppToken->name, 0, 16);
else else
ppToken->ival = strtol(ppToken->name, 0, 8); ppToken->ival = strtol(ppToken->name, 0, 8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment