aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-06-06 17:32:44 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-06-06 17:32:44 -0700
commitdb6960c3fa0483514eb2e6042ddd4bddf6536b0a (patch)
tree89dc3292eeb048684f26591237a8e19cbcec00d6
parent10d9589f0294a78d1a993da697d2d87414d80534 (diff)
downloadnasm-db6960c3fa0483514eb2e6042ddd4bddf6536b0a.tar.gz
nasm-db6960c3fa0483514eb2e6042ddd4bddf6536b0a.tar.xz
nasm-db6960c3fa0483514eb2e6042ddd4bddf6536b0a.zip
quote: improve comment
Explain why 0xfc + vb5 cannot overflow a byte value. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--asm/quote.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/asm/quote.c b/asm/quote.c
index ae8a293a..58bb5a10 100644
--- a/asm/quote.c
+++ b/asm/quote.c
@@ -226,6 +226,9 @@ static unsigned char *emit_utf8(unsigned char *q, uint32_t v)
* something vaguely sensible with it. Caveat programmer.
* The __utf*__ string transform functions do reject these
* as invalid input.
+ *
+ * vb5 cannot be more than 3, as a 32-bit value has been shifted
+ * right by 5*6 = 30 bits already.
*/
vb5 = vb4 >> 6;
*q++ = 0xfc + vb5;