fix random crash with -cov
Merge pull request #449 from WalterBright/fixcovercrash

fix random crash with -cov