fix Issue 10836 - 'errors compiling the function' for optimized builds
Merge pull request #2488 from 9rnsr/fix10836

[REG2.064a] Issue 10836 - 'errors compiling the function' for optimized builds