Fix segv in constant folding of xor ops.

github 40

And add a test.