summaryrefslogtreecommitdiff
path: root/upb/pb/compile_decoder.c
diff options
context:
space:
mode:
authorNicolas Noble <nicolasnoble@users.noreply.github.com>2019-07-31 15:32:49 -0700
committerGitHub <noreply@github.com>2019-07-31 15:32:49 -0700
commit638d114a1ac20a79bf7490eef6625f15bc61d52b (patch)
treec9732dec7f92679619dbb1589318b3f369f1f646 /upb/pb/compile_decoder.c
parent7e7cb5f831a97655a2d28ed49b485e14a9dd8188 (diff)
parentbc8b1a8f90706c7178fc0a128a7a791b85bbe88f (diff)
Merge pull request #200 from veblush/ubsan
Fixed UBSAN issues
Diffstat (limited to 'upb/pb/compile_decoder.c')
-rw-r--r--upb/pb/compile_decoder.c2
1 files changed, 1 insertions, 1 deletions
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);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback