From a2553489a66f6c0ccb937cdaaa643f9f037cf51b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 22 Feb 2016 18:28:07 +0100 Subject: WAGE: Added safeguard checks for operands --- engines/wage/script.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engines/wage/script.h b/engines/wage/script.h index 1a7d07d29a..a91598094c 100644 --- a/engines/wage/script.h +++ b/engines/wage/script.h @@ -80,31 +80,37 @@ private: Operand(Obj *value, OperandType type) { _value.obj = value; + assert(type == OBJ); _type = type; } Operand(Chr *value, OperandType type) { _value.chr = value; + assert(type == CHR); _type = type; } Operand(Scene *value, OperandType type) { _value.scene = value; + assert(type == SCENE); _type = type; } Operand(int value, OperandType type) { _value.number = value; + assert(type == NUMBER); _type = type; } Operand(Common::String *value, OperandType type) { _value.string = value; + assert(type == STRING); _type = type; } Operand(Designed *value, OperandType type) { _value.inputClick = value; + assert(type == CLICK_INPUT); _type = type; } -- cgit v1.2.3