ruiu added a comment. I believe what you are doing in this patch is correct, but the error message is inappropriate, as the range [-256, 255] is too large. As an error message, it doesn't make sense. -256 is not represenable in one byte. https://reviews.llvm.org/D45051