Fixed UBSAN error.

pull/13171/head
Joshua Haberman 3 years ago
parent 58968d6a78
commit 2199be91bc
  1. 9
      .bazelrc
  2. 2
      upb/decode.c

@ -46,3 +46,12 @@ build:msan-libfuzzer --action_env=CXX=clang++
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=msan
# --config=ubsan-libfuzzer
build:ubsan-libfuzzer --action_env=CC=clang
build:ubsan-libfuzzer --action_env=CXX=clang++
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:ubsan-libfuzzer --copt=-fsanitize=undefined
build:ubsan-libfuzzer --linkopt=-fsanitize=undefined
build:ubsan-libfuzzer --linkopt=-fsanitize-link-c++-runtime

@ -918,7 +918,7 @@ static const char *decode_unknown(upb_decstate *d, const char *ptr,
}
assert(start == d->debug_valstart);
uint32_t tag = (field_number << 3) | wire_type;
uint32_t tag = ((uint32_t)field_number << 3) | wire_type;
start = decode_reverse_skip_varint(start, tag);
assert(start == d->debug_tagstart);

Loading…
Cancel
Save