mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
- Work around issue with tree-loop-vectorize in p_acs.cpp.
This commit is contained in:
parent
f9ae304596
commit
8f31af3ff9
1 changed files with 6 additions and 3 deletions
|
@ -1954,11 +1954,14 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
|
||||||
int arraynum = MapVarStore[LittleLong(chunk[2])];
|
int arraynum = MapVarStore[LittleLong(chunk[2])];
|
||||||
if ((unsigned)arraynum < (unsigned)NumArrays)
|
if ((unsigned)arraynum < (unsigned)NumArrays)
|
||||||
{
|
{
|
||||||
int initsize = MIN<int> (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4);
|
// Use unsigned iterator here to avoid issue with GCC 4.9/5.x
|
||||||
|
// optimizer. Might be some undefined behavior in this code,
|
||||||
|
// but I don't know what it is.
|
||||||
|
unsigned int initsize = MIN<unsigned int> (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4);
|
||||||
SDWORD *elems = ArrayStore[arraynum].Elements;
|
SDWORD *elems = ArrayStore[arraynum].Elements;
|
||||||
for (i = 0; i < initsize; ++i)
|
for (unsigned int j = 0; j < initsize; ++j)
|
||||||
{
|
{
|
||||||
elems[i] = LittleLong(chunk[3+i]);
|
elems[j] = LittleLong(chunk[3+j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chunk = (DWORD *)NextChunk((BYTE *)chunk);
|
chunk = (DWORD *)NextChunk((BYTE *)chunk);
|
||||||
|
|
Loading…
Reference in a new issue