From 589d8b40b74cd5d3b16dad2766f906e7327ff181 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 18 Mar 2024 06:02:28 +0100 Subject: [PATCH] Fix LLVM constant string escaping emit (#79) --- ir_emit_llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir_emit_llvm.c b/ir_emit_llvm.c index 81bfdc07..9efcdf1e 100644 --- a/ir_emit_llvm.c +++ b/ir_emit_llvm.c @@ -1278,7 +1278,7 @@ static int ir_emit_func(ir_ctx *ctx, const char *name, FILE *f) char c = str[j]; if (c < ' ' || c >= 127) { - char c1 = c >> 8; + char c1 = (c >> 4) & 15; char c2 = c & 15; c1 = (c1 < 10) ? (c1 + '0') : (c1 - 10 + 'A'); c2 = (c2 < 10) ? (c2 + '0') : (c2 - 10 + 'A');