From bc8b1a8f90706c7178fc0a128a7a791b85bbe88f Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 31 Jul 2019 14:20:46 -0700 Subject: Fixed UBSAN issues --- upb/pb/compile_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'upb/pb/compile_decoder.c') diff --git a/upb/pb/compile_decoder.c b/upb/pb/compile_decoder.c index 1b40302..63d7fe2 100644 --- a/upb/pb/compile_decoder.c +++ b/upb/pb/compile_decoder.c @@ -149,7 +149,7 @@ static int32_t getofs(uint32_t instruction) { static void setofs(uint32_t *instruction, int32_t ofs) { if (op_has_longofs(*instruction)) { - *instruction = getop(*instruction) | ofs << 8; + *instruction = getop(*instruction) | (uint32_t)ofs << 8; } else { *instruction = (*instruction & ~0xff00) | ((ofs & 0xff) << 8); } -- cgit v1.2.3