This code is very old, so I don't feel very confident touching it without a second opinion. I noticed this while I was trying to integrate undef into the solver.
The problem is that when we visit and/or, we try to derive a lattice value for the instruction even if one of the operands is overdefined.
My understanding is:
When we arrive at this point we already called getValueState() on the non-overdefined operand, so if the value is still in the 'unknown' state it means that it was found to be an 'undef' value.
I think the correct thing to do in this case is just return and wait for ResolvedUndefsIn to "plug in" the correct value, rather than calling markConstant as it's currently done.
While I was there, I added some tests for this code that were missing.
This is okay, I guess, but I don't think it fixes anything.