@vampiress I stubbed my toe on a text book variant of this very recently where I simply had to duplicate the top stack element, like:
stack[stack_height++] = stack[stack_height-1];
The RHS was "hidden" behind a function call which made it slightly harder to see straight away. I didn't see the bug until I tried compiling it on clang instead of gcc.
So.. I'm half-seriously looking into Ada now :-) (also because it's not the only recent disappointment I've had with C)