WIP: Fix warnings with static analysis - part 2
More asserts...I'm not particularly happy with the solutions here and there's at least one clearly buggy case which should get fixed in gcc. Therefore wip and suggestions welcome.
Together with !1246 (closed) fixes #1247
Edited by Florian Müllner