This patch adds an assert to check if the result of `getConstantInt` is non-null. Previously the code failed with Segmentation Fault if `getConstantInt` failed to look up the value. This primarily occurrs when the value is defined as OpSpecConstant rather than OpConstant.