When using a struct inside a List<T>
access to that list corrupts variables in the current scope.
It seems to occure on iOS 32 bit.
Fuse version: I think I noticed it first in 0.9.7.554 still in 0.10.0.5986
struct TesterData
{
public long Data1;
public long Data2;
public long Data3;
}
List<TesterData> mList = new List<TesterData>();
public Tester1()
{
var d1 = new TesterData();
d1.Data1 = 4848;
d1.Data2 = 6682;
d1.Data3 = 4983;
mList.Add(d1);
}
public void test(long p1, long p2)
{
long pp3 = 3;
if(p1 != 1 || p2 != 2 || pp3 != 3)
throw new Exception();
/ this call accesses memory of p2 /
var enumer = mList.GetEnumerator();
/ p2 is 0 /
if(p1 != 1 || p2 != 2 || pp3 != 3)
throw new Exception();
enumer.MoveNext();
if(p1 != 1 || p2 != 2 || pp3 != 3)
throw new Exception();
}