Fixes issue #5
This commit is contained in:
parent
09501d22fd
commit
62d1695632
|
@ -755,7 +755,7 @@ void ExpressionPrefixOperator(struct ParseState *Parser,
|
|||
int Size = TypeSize(TopValue->Typ->FromType, 0, true);
|
||||
struct Value *StackValue;
|
||||
void *ResultPtr;
|
||||
if (TopValue->Val->Pointer == NULL)
|
||||
if (Op != TokenUnaryNot && TopValue->Val->Pointer == NULL)
|
||||
ProgramFail(Parser, "a. invalid use of a NULL pointer");
|
||||
if (!TopValue->IsLValue)
|
||||
ProgramFail(Parser, "can't assign to this");
|
||||
|
@ -768,6 +768,10 @@ void ExpressionPrefixOperator(struct ParseState *Parser,
|
|||
TopValue->Val->Pointer =
|
||||
(void*)((char*)TopValue->Val->Pointer-Size);
|
||||
break;
|
||||
case TokenUnaryNot:
|
||||
TopValue->Val->Pointer =
|
||||
(void*)((char*)(!TopValue->Val->Pointer));
|
||||
break;
|
||||
default:
|
||||
ProgramFail(Parser, "invalid operation");
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue