fix Issue 13187 - Function wrongly deduced as pure
Merge pull request #3864 from 9rnsr/fix13187

[REG2.066a] Issue 13187 - Function wrongly deduced as pure