mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
Fix (or work around?) strange bug on Windows
The definition of std::max uses references for parameters, which leads to unnecessary storing of constants on the stack. If the stack is overwritten this leads to wrong results. max2() works around this using call-by-value.
This commit is contained in:
parent
cd314e2f45
commit
002a2cba6b
@ -693,9 +693,9 @@ namespace netgen
|
||||
{
|
||||
facecoeffsindex[i] = nd;
|
||||
if (top.GetFaceType(i+1) == TRIG)
|
||||
nd += max (0, (faceorder[i]-1)*(faceorder[i]-2)/2);
|
||||
nd += max2 (0, (faceorder[i]-1)*(faceorder[i]-2)/2);
|
||||
else
|
||||
nd += max (0, sqr(faceorder[i]-1));
|
||||
nd += max2 (0, sqr(faceorder[i]-1));
|
||||
}
|
||||
facecoeffsindex[nfaces] = nd;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user