Fix array in a class not working with sizeof()...

...when no assignment is made in the definition.

It should pass this unit test now:
TEST_F(CBotUT, DISABLED_ArraysInClasses)
dev-time-step
melex750 2016-04-05 14:28:36 -04:00
parent 61440392d2
commit 748f0034bd
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include "CBot/CBotInstr/CBotInstrUtils.h" #include "CBot/CBotInstr/CBotInstrUtils.h"
#include "CBot/CBotInstr/CBotNew.h" #include "CBot/CBotInstr/CBotNew.h"
#include "CBot/CBotInstr/CBotLeftExprVar.h" #include "CBot/CBotInstr/CBotLeftExprVar.h"
#include "CBot/CBotInstr/CBotExprLitNull.h"
#include "CBot/CBotInstr/CBotTwoOpExpr.h" #include "CBot/CBotInstr/CBotTwoOpExpr.h"
#include "CBot/CBotInstr/CBotFunction.h" #include "CBot/CBotInstr/CBotFunction.h"
#include "CBot/CBotInstr/CBotExpression.h" #include "CBot/CBotInstr/CBotExpression.h"
@ -722,6 +723,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
} }
if ( !pStack->IsOk() ) return false; if ( !pStack->IsOk() ) return false;
} }
else if ( type2.Eq(CBotTypArrayPointer) ) i = new CBotExprLitNull();
if ( !bSecond ) if ( !bSecond )