diff --git a/expression.c b/expression.c index 1698005..828724c 100644 --- a/expression.c +++ b/expression.c @@ -938,6 +938,18 @@ XXX - finish this ExpressionPushPointer(Parser, StackTop, ResultInt); } #endif + else if (Op == TokenAssign) + { + /* assign a non-numeric type */ + if (!BottomValue->IsLValue) + ProgramFail(Parser, "can't assign to this"); + + if (BottomValue->Typ != TopValue->Typ) + ProgramFail(Parser, "can't assign to a different type of variable"); + + memcpy(BottomValue->Val, TopValue->Val, TypeSizeValue(TopValue)); + ExpressionStackPushValue(Parser, StackTop, TopValue); + } else ProgramFail(Parser, "invalid operation"); }