Commit 11f5fc04 by John Kessenich

glslang preprocassor: Fix operator precedence bug.

parent b7cc3311
......@@ -54,7 +54,7 @@
#include <vector>
#include <iostream>
#include <cassert>
#include <assert.h>
namespace spv {
......
......@@ -221,7 +221,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
case CPP_UINTCONSTANT:
strcpy(ppToken->name, tokenText);
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);
else
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