bitcoin/bitcoin — pull request #1868 by maaku (2012-09-25 23:46:11+00:00)
Title: Documented bug in sign-extension behavior of opcodes OP_AND, OP_OR, and OP_XOR

Due to a bug in the implementation of MakeSameSize(), using OP_AND, OP_OR, or OP_XOR with signed values of unequal size will result in the sign-value becoming part of the smaller integer, with nonsensical results. This patch documents the unexpected behavior and provides the basis of a solution should decision be made to fix the bug in the future.